Skip to content

Update to gradle 9.3.1 and update plugins#13

Open
wmdietl wants to merge 23 commits intomain-eisopfrom
gradle-9.0.0
Open

Update to gradle 9.3.1 and update plugins#13
wmdietl wants to merge 23 commits intomain-eisopfrom
gradle-9.0.0

Conversation

@wmdietl
Copy link
Copy Markdown
Member

@wmdietl wmdietl commented Aug 4, 2025

No description provided.

Comment thread .github/workflows/build.yml Outdated
with:
repository: jspecify/jspecify
path: jspecify
ref: gradle-9.0.0
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, still fails. Can't reproduce locally yet.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wmdietl
Copy link
Copy Markdown
Member Author

wmdietl commented Sep 20, 2025

Copying comments from .github/workflows/build.yml, b/c the change on that line will need to be undone. The change was to use branch gradle-9.0.0 of jspecify/jspecify.

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.


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.
@wmdietl
Copy link
Copy Markdown
Member Author

wmdietl commented Sep 20, 2025

When using jspecify/jspecify main, which doesn't use Gradle 9.0.0 yet, I again get this error:

* What went wrong:
A problem occurred configuring project ':jspecify'.
> Failed to notify project evaluation listener.
   > org.gradle.api.plugins.internal.DefaultDecoratedConvention

So I'll wait with merging this PR until I merged jspecify/jspecify#755.

@wmdietl wmdietl changed the title Update to gradle 9.0.0 Update to gradle 9.0.0 and update plugins Sep 23, 2025
@wmdietl wmdietl changed the title Update to gradle 9.0.0 and update plugins Update to gradle 9.3.1 and update plugins Feb 3, 2026
Copilot AI review requested due to automatic review settings April 5, 2026 19:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread settings.gradle
@@ -6,13 +6,6 @@ include 'conformance-test-framework'
// See https://docs.gradle.org/current/userguide/composite_builds.html#included_build_declaring_substitutions
includeBuild(".")

Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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."
)
}

Copilot uses AI. Check for mistakes.
Comment thread gradle.properties
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8
org.gradle.caching=true
org.gradle.configuration-cache=true
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
org.gradle.configuration-cache=true
org.gradle.configuration-cache=false

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants