Prepare for upgrading Gradle from 8.13 to 9.5#4140
Merged
Conversation
150e725 to
6c8997f
Compare
alecgrieser
approved these changes
May 14, 2026
Collaborator
alecgrieser
left a comment
There was a problem hiding this comment.
LGTM. I've attached run mixed mode to the PR so that we get coverage of the changes to the mixed mode components of testing, but overall, it seems good.
Contributor
Author
The mixed mode actually revealed further deprecation warnings, so good call. It’s like a whack-a-mole game 😀 |
This change fixes further Gradle deprecation warnings. * In `build.gradle`, the `archives` configuration is deprecated for artifact declaration. Attach `sourcesJar`, `javadocJar`, and `testJar` directly to the `assemble` task instead, which is the behavior `archives` was previously providing. * Also in `build.gradle`, in `updateYamsql()`, capture `project.version` and the resolved set of yamsql files at configuration time so the `doLast` block no longer dereferences `Project` at execution time. Accessing `Task.project` at execution time becomes an error in Gradle 10. * In `check.gradle`, change Groovy space-assignment syntax to `=` assignment, as the former is deprecated in Gradle 9. * In `sphinx.gradle` (and also in `build.gradle` at `updateYamsql`), replace `exec` invocations with `ExecOperations`, injected via a script-local `InjectedExecOps` helper. `Project#exec` is deprecated in Gradle 8 and removed in Gradle 9. * In `testing.gradle`, migrate from the deprecated closure-based `beforeTest`, `afterTest`, and `afterSuite` methods on `Test` to the documented replacement, `addTestListener(TestListener)`. * Also in `testing.gradle`, explicitly set `testClassesDirs` and `classpath` on custom `Test` tasks. Gradle 9 removes the convention that made these default to the value of the built-in `test` task. Without this fix, `destructiveTest`, `performanceTest`, `quickTest`, `rpcTest`, `singleVersionTest`, and `mixedModeTest` would silently collect no tests once the upgrade lands. * `yaml-tests.gradle`: Use single-string dependency notation in the `resolveOtherServer` and `resolveSpecificServer` helpers. Multi-string map notation is deprecated in Gradle 9 and fails with an error in Gradle 10. * Also in `yaml-tests.gradle`, eliminate `Task.project` accesses at execution time by capturing `providers.gradleProperty` and `layout.buildDirectory.file` into locals at configuration time, and reading them from `doLast` instead of dereferencing `project` directly.
alecgrieser
approved these changes
May 14, 2026
ScottDugas
approved these changes
May 14, 2026
| var venvDir = "${sphinxRoot}/.venv" | ||
| var sphinxBuildDir = "${sphinxRoot}/.out" | ||
|
|
||
| // Gives tasks access to an injected `ExecOperations` for running external processes from a `doLast` block. |
Collaborator
There was a problem hiding this comment.
I noticed this tip:
This is a good time to consider extracting the ad-hoc task into a proper class.
Not part of this PR, but something I will be thinking about
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.
This change fixes further Gradle deprecation warnings.
In
build.gradle, thearchivesconfiguration is deprecated for artifact declaration. AttachsourcesJar,javadocJar, andtestJardirectly to theassembletask instead, which is the behaviorarchiveswas previously providing.Also in
build.gradle, inupdateYamsql(), captureproject.versionand the resolved set of yamsql files at configuration time so thedoLastblock no longer dereferencesProjectat execution time. AccessingTask.projectat execution time becomes an error in Gradle 10.In
check.gradle, change Groovy space-assignment syntax to=assignment, as the former is deprecated in Gradle 9.In
sphinx.gradle(and also inbuild.gradleatupdateYamsql), replaceexecinvocations withExecOperations, injected via a script-localInjectedExecOpshelper.Project#execis deprecated in Gradle 8 and removed in Gradle 9.In
testing.gradle, migrate from the deprecated closure-basedbeforeTest,afterTest, andafterSuitemethods onTestto the documented replacement,addTestListener(TestListener).Also in
testing.gradle, explicitly settestClassesDirsandclasspathon customTesttasks. Gradle 9 removes the convention that made these default to the value of the built-intesttask. Without this fix,destructiveTest,performanceTest,quickTest,rpcTest,singleVersionTest, andmixedModeTestwould silently collect no tests once the upgrade lands.yaml-tests.gradle: Use single-string dependency notation in theresolveOtherServerandresolveSpecificServerhelpers. Multi-string map notation is deprecated in Gradle 9 and fails with an error in Gradle 10.Also in
yaml-tests.gradle, eliminateTask.projectaccesses at execution time by capturingproviders.gradlePropertyandlayout.buildDirectory.fileinto locals at configuration time, and reading them fromdoLastinstead of dereferencingprojectdirectly.