Migrate to Gradle 9.5.1#11
Draft
cobexer wants to merge 7 commits into
Draft
Conversation
53f2208 to
69369df
Compare
There was a problem hiding this comment.
Pull request overview
Migrates the project build and test infrastructure to run on Gradle 9.5.1 / Groovy 4 (Spock 2.4 groovy-4.0), updating the build builder’s generated builds and integration tests to reflect Gradle 9+/AGP 8+ conventions and newer toolchains.
Changes:
- Upgraded Gradle wrapper and refactored build/test setup to use version catalogs, modern repositories, and JUnit Platform-based Spock execution.
- Updated generators and integration tests for newer Gradle/AGP/Swift/C++ behaviors (AndroidX, maven-publish, Swift XCTest main, HTTP repo publishing workflow).
- Replaced the CLI implementation (airlift/airline → picocli) and improved test robustness/perf (timeouts, bounded output handling, reduced Swift matrix).
Reviewed changes
Copilot reviewed 49 out of 51 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/groovy/org/gradle/builds/SwiftBuildSourceDepsIntegrationTest.groovy | Swift test updates (IgnoreIf on macOS, app path casing). |
| src/test/groovy/org/gradle/builds/SwiftBuildIntegrationTest.groovy | Swift test updates (IgnoreIf, XCTestMain.swift expectations, reduced N). |
| src/test/groovy/org/gradle/builds/SwiftBuildBuildSrcIntegrationTest.groovy | Swift buildSrc test now uses Swift-specific base + macOS ignore. |
| src/test/groovy/org/gradle/builds/KotlinBuildIntegrationTest.groovy | Kotlin test assertions made version-agnostic for jar names. |
| src/test/groovy/org/gradle/builds/JavaBuildIntegrationTest.groovy | Adjusted expected generated child build directory casing. |
| src/test/groovy/org/gradle/builds/JavaBuildHttpRepoIntegrationTest.groovy | Switched HTTP repo tests to :publishHttpRepo flow (no external server process). |
| src/test/groovy/org/gradle/builds/CppBuildHttpRepoIntegrationTest.groovy | Same HTTP repo workflow change for C++ builds. |
| src/test/groovy/org/gradle/builds/CppBuildComplexCompositionIntegrationTest.groovy | Same HTTP repo workflow change for complex C++ composition. |
| src/test/groovy/org/gradle/builds/AndroidBuildSourceDepsIntegrationTest.groovy | Adjusted Android source-deps directory casing expectations. |
| src/test/groovy/org/gradle/builds/AndroidBuildIntegrationTest.groovy | AndroidX API expectation update. |
| src/test/groovy/org/gradle/builds/AndroidBuildHttpRepoIntegrationTest.groovy | Same HTTP repo workflow change for Android builds. |
| src/test/groovy/org/gradle/builds/AbstractSwiftIntegrationTest.groovy | New Swift test base with macOS skip rationale. |
| src/test/groovy/org/gradle/builds/AbstractIntegrationTest.groovy | Modernized test infrastructure (TempDir, bounded waits, log redirection, GradleRunner updates). |
| src/test/groovy/org/gradle/builds/AbstractAndroidIntegrationTest.groovy | Removed old Gradle 5.x pin for Android integration tests. |
| src/main/kotlin/org/gradle/builds/generators/GradlePropertiesGenerator.kt | Emits AndroidX/Jetifier flags + heap sizing based on components. |
| src/main/kotlin/org/gradle/builds/assemblers/KotlinModelAssembler.kt | Switched repositories to Maven Central + modern application main class DSL. |
| src/main/kotlin/org/gradle/builds/assemblers/GradlePluginModelAssembler.kt | Migrated repos, dependency config, Java compat cap, capitalization fix. |
| src/main/java/org/gradle/builds/model/HttpServerImplementation.java | HTTP repo implementation now models heap needs and repo dir (no fixed port). |
| src/main/java/org/gradle/builds/model/HttpRepository.java | Removed fixed-port/URI construction; now models just repo root dir. |
| src/main/java/org/gradle/builds/model/HasCppSource.java | Adds heap sizing guidance for C++ builds. |
| src/main/java/org/gradle/builds/model/DefaultBuildStructureBuilder.java | Nullable annotation migrated to JSpecify. |
| src/main/java/org/gradle/builds/model/BlockWithRepositories.java | Repository DSL updated for Maven Central + HTTP repo port indirection. |
| src/main/java/org/gradle/builds/model/AndroidComponent.java | Updated Android heap sizing for AGP 8.x. |
| src/main/java/org/gradle/builds/Main.java | CLI migrated from airline to picocli. |
| src/main/java/org/gradle/builds/generators/SwiftSourceGenerator.java | Generates XCTestMain.swift and Linux allTests for XCTest execution. |
| src/main/java/org/gradle/builds/generators/SettingsFileGenerator.java | Generates settings.gradle with embedded HTTP repo server BuildService. |
| src/main/java/org/gradle/builds/generators/HttpServerMainGenerator.java | Removed standalone HTTP server app generator. |
| src/main/java/org/gradle/builds/generators/GitRepoGenerator.java | Sets explicit author/committer when generating git repos. |
| src/main/java/org/gradle/builds/generators/AndroidManifestGenerator.java | AGP 8 namespace + android:exported updates. |
| src/main/java/org/gradle/builds/assemblers/SwiftModelAssembler.java | Pins Swift language mode to Swift 5 for Swift 6 compatibility. |
| src/main/java/org/gradle/builds/assemblers/LanguageSpecificProjectConfigurer.kt | Kotlin string capitalization updated for Kotlin 2.x. |
| src/main/java/org/gradle/builds/assemblers/JvmModelAssembler.java | Uses Maven Central + centralizes JUnit4 coordinate constant. |
| src/main/java/org/gradle/builds/assemblers/JavaModelAssembler.java | Modern application DSL + maven-publish + modern test configuration. |
| src/main/java/org/gradle/builds/assemblers/HttpServerModelAssembler.java | Reworked HTTP repo publication wiring with publishHttpRepo aggregator task. |
| src/main/java/org/gradle/builds/assemblers/HttpRepoModelStructureAssembler.java | HTTP repo now hosted by main build (no separate repo-server build). |
| src/main/java/org/gradle/builds/assemblers/CppModelAssembler.java | Updated Boost linker config to modern native tasks. |
| src/main/java/org/gradle/builds/assemblers/AndroidModelAssembler.java | Updated to AGP 8 conventions (AndroidX deps, namespace DSL, publish wiring). |
| src/main/java/org/gradle/builds/assemblers/AndroidBuildProjectInitializer.java | Updates Java target level for Android-associated Java libs. |
| settings.gradle.kts | Adds Develocity plugins to the build. |
| gradlew.bat | Wrapper script updated for new Gradle wrapper version. |
| gradlew | Wrapper script updated for new Gradle wrapper version. |
| gradle/wrapper/gradle-wrapper.properties | Wrapper bumped to Gradle 9.5.1 (and wrapper properties updated). |
| gradle/libs.versions.toml | Introduces version catalog (including generator-emitted coordinates). |
| gradle/gradle-daemon-jvm.properties | Configures Gradle daemon toolchain version. |
| gradle.properties | Sets Gradle daemon JVM args for the build itself. |
| buildSrc/src/main/kotlin/build-builder.generator-versions.gradle.kts | New buildSrc plugin to generate GeneratorVersions from catalog entries. |
| buildSrc/settings.gradle.kts | Build logic buildSrc settings. |
| buildSrc/build.gradle.kts | Build logic buildSrc build config. |
| build.gradle.kts | Migrated dependencies/plugins + JvmTestSuite configuration for Spock. |
| .github/workflows/ci.yml | CI updated for Java 25 + Swift/Boost/Android SDK provisioning and test artifacts on failure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+45
to
+48
| public void run(String... args) throws Exception { | ||
| new CommandLine(this) | ||
| .setExecutionExceptionHandler((ex, cmd, parseResult) -> { throw ex; }) | ||
| .execute(args); |
Comment on lines
+25
to
+31
| public void maven(HttpRepository repo) { | ||
| ScriptBlock block = new ScriptBlock("maven"); | ||
| block.property("url", repo.getUri().toString()); | ||
| // The repo is served by an embedded HttpServer started as a Gradle | ||
| // BuildService from settings.gradle; the assigned port is exposed via | ||
| // gradle.ext.httpRepoPort. Parallel test forks each get their own. | ||
| block.property("url", new Scope.Code( | ||
| "\"http://localhost:${gradle.httpRepoPort}/\"")); |
| pw.println(" catch (BindException ignored) { return HttpServer.create(new InetSocketAddress(0), 20) }"); | ||
| pw.println(" }"); | ||
| pw.println(); | ||
| pw.println(" @Override void close() { server.stop(0) }"); |
Comment on lines
+7
to
+13
| /** | ||
| * Wires the GradleBuild publish tasks for each external library build into | ||
| * the consuming (main) build's root project, and forces the standard entry | ||
| * tasks (build/assemble/installDist/etc.) to depend on them so the http-repo | ||
| * is populated before the embedded server starts answering resolution | ||
| * requests. | ||
| */ |
a245f5b to
6677d92
Compare
Strip trailing -<version>.jar from lib-dir filenames before comparing, so dependdency bumps don't require lockstep edits to the assertions. Signed-off-by: Christoph Obexer <cobexer@gradle.com>
Signed-off-by: Christoph Obexer <cobexer@gradle.com>
bf52082 to
4a88994
Compare
Signed-off-by: Christoph Obexer <cobexer@gradle.com>
…binary Signed-off-by: Christoph Obexer <cobexer@gradle.com>
Signed-off-by: Christoph Obexer <cobexer@gradle.com>
Signed-off-by: Christoph Obexer <cobexer@gradle.com>
* Add Java 25 toolchain for compilation and Gradle daemon * buildSrc: cap targetCompatibility at Java 17 in generated plugin builds Gradle 9.0 bundles a version of ASM that does not understand class file major version 69 (Java 25). Signed-off-by: Christoph Obexer <cobexer@gradle.com>
4a88994 to
15e8964
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #10.
Changes
spock-corefrom2.4-groovy-3.0to2.4-groovy-4.0Why
Gradle 9.5.1 ships with Groovy 4.0.29. The
groovy-3.0Spock variant is rejected at compile time with:The
groovy-4.0variant of the same Spock 2.4 release is a drop-in replacement.Test plan
buildcheck passes (compileTestGroovy succeeds with Groovy 4)