Update to gradle 9.3.1 and update plugins#13
Conversation
| with: | ||
| repository: jspecify/jspecify | ||
| path: jspecify | ||
| ref: gradle-9.0.0 |
There was a problem hiding this comment.
Without this, CI is failing with
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':jspecify'.
> Failed to notify project evaluation listener.
> org.gradle.api.plugins.internal.DefaultDecoratedConvention
It seems rather odd that gradle doesn't play well together with an not much older version of gradle used in that other project.
There was a problem hiding this comment.
No, still fails. Can't reproduce locally yet.
There was a problem hiding this comment.
I looked at the wrong branch. The issue was that the samples-google-prototype-eisop further down was using Gradle 8.9. jspecify/jspecify#768 fixed this and now this PR works.
I think it works even without #16 because the gradle-9.0.0 branch was made before the recent changes in jspecify/jspecify.
|
Copying comments from Without this, CI is failing with It seems rather odd that gradle doesn't play well together with an not much older version of gradle used in that other project. No, still fails. Can't reproduce locally yet. I looked at the wrong branch. The issue was that the samples-google-prototype-eisop further down was using Gradle 8.9. jspecify/jspecify#768 fixed this and now this PR works. I think it works even without #16 because the gradle-9.0.0 branch was made before the recent changes in jspecify/jspecify. |
Likely conformance tests will fail, which #16 will fix.
|
When using jspecify/jspecify main, which doesn't use Gradle 9.0.0 yet, I again get this error: So I'll wait with merging this PR until I merged jspecify/jspecify#755. |
…nfiguration cache
There was a problem hiding this comment.
Pull request overview
Upgrades the build to Gradle 9.3.1 and refreshes key build plugins/dependencies, with follow-up build-script refactors to better support modern Gradle features and multi-JDK CI.
Changes:
- Bump Gradle wrapper to 9.3.1 and update Spotless/Error Prone plugin + dependency versions.
- Rework parts of the root build to support newer Gradle behavior (configuration cache, task wiring, updated tasks for JDK stubs/conformance tests).
- Minor Java source updates (tree-kind checks refactored to
instanceof) and small formatting/comment adjustments.
Reviewed changes
Copilot reviewed 9 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
build.gradle |
Updates plugin versions; refactors Error Prone enabling, JDK stub generation tasks, conformance test tasks, and demo test output handling. |
gradle.properties |
Enables parallelism, caching, and configuration cache by default; sets JVM args. |
gradle/wrapper/gradle-wrapper.properties |
Updates Gradle distribution URL to 9.3.1. |
gradle/wrapper/gradle-wrapper.jar |
Updates wrapper JAR to match Gradle 9.3.1. |
gradlew / gradlew.bat |
Wrapper script updates consistent with newer Gradle wrapper behavior. |
settings.gradle |
Removes initialize-project execution; updates Error Prone core version in the version catalog. |
.github/workflows/build.yml |
Adds a JDK matrix and updates Gradle invocations with --warning-mode all / config-cache flags for publish. |
usage-demo/build.gradle |
Updates demo plugin/dependency versions and Spotless indentation configuration. |
src/main/java/com/google/jspecify/nullness/NullSpecVisitor.java |
Replaces Tree.Kind comparisons with instanceof checks in several places. |
src/main/java/com/google/jspecify/nullness/NullSpecAnnotatedTypeFactory.java |
Replaces Tree.Kind comparisons with instanceof checks in method-select handling. |
src/test/java/tests/NullSpecTest.java |
Comment indentation/formatting change. |
conformance-test-framework/.../ConformanceTestRunner.java |
Comment indentation/formatting change (// fall-through). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -6,13 +6,6 @@ include 'conformance-test-framework' | |||
| // See https://docs.gradle.org/current/userguide/composite_builds.html#included_build_declaring_substitutions | |||
| includeBuild(".") | |||
|
|
|||
There was a problem hiding this comment.
Removing the ./initialize-project execution means the build now assumes sibling repos (notably ../jdk, referenced by jspecifyJdkHome in build.gradle) are already present. If this is intentional (e.g., for configuration-cache compatibility), consider adding a documented/manual bootstrap step (or a dedicated Gradle task) so first-time contributors don’t hit a confusing missing-directory failure.
| File jspecifyJdkHome = file("../jdk") | |
| if (!jspecifyJdkHome.isDirectory()) { | |
| throw new GradleException( | |
| "Missing required sibling repository: ${jspecifyJdkHome}. " + | |
| "This build expects a checkout of the JDK repository at ../jdk. " + | |
| "If you are setting up the project for the first time, run ./initialize-project " + | |
| "or otherwise bootstrap the required sibling repositories before invoking Gradle." | |
| ) | |
| } |
| org.gradle.parallel=true | ||
| org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8 | ||
| org.gradle.caching=true | ||
| org.gradle.configuration-cache=true |
There was a problem hiding this comment.
Enabling org.gradle.configuration-cache=true by default will surface configuration-cache incompatibilities immediately. As-is, the build script still performs file I/O during task configuration (e.g., copyJSpecifyJDK scans files in its configuration block), which will likely prevent configuration-cache reuse. Either make the build fully configuration-cache compatible or consider leaving configuration cache off by default and enabling it only in CI/opt-in until compatibility is complete.
| org.gradle.configuration-cache=true | |
| org.gradle.configuration-cache=false |
No description provided.