Address Gradle 9.6 API deprecations - #22
Merged
Merged
Conversation
Replace the deprecated Kotlin DSL property-delegate APIs with the configuration-avoidance equivalents: * `by tasks.registering` -> `tasks.register(name)`; * `by tasks.getting` -> `tasks.named(name)`; * `by getting(JvmTestSuite::class)` -> `named<JvmTestSuite>(name)`; * `by extra` -> `extra[name] as String`. Also drop the `idea` plugin. It is deprecated in Gradle 9.7 and scheduled for removal in Gradle 10. The plugin was applied but never configured, and IntelliJ IDEA imports the project natively, so its generated files were unused. Dropping it retires the `notCompatibleWithConfigurationCache` workaround for `ideaModule` (see gradle/gradle#13480). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Regenerate the reports for version `0.17.2`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #22 +/- ##
=========================================
Coverage 14.40% 14.40%
Complexity 9 9
=========================================
Files 5 5
Lines 118 118
Branches 6 6
=========================================
Hits 17 17
Misses 101 101 🚀 New features to boost your workflow:
|
Replace the string-based `named("publish")` lookup with the generated
`publish { }` accessor, matching `publishPlugins { }` in the same
`tasks { }` block.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
armiol
approved these changes
Sep 1, 2026
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.
What changed
CI was emitting ~25 deprecation warnings from the Gradle 9.6 upgrade. This clears all of them.
1. Kotlin DSL property delegates → configuration-avoidance APIs
Gradle 9.6 deprecated the
by tasks.registering/by tasks.getting/by extradelegatesugar.
gettingin particular is eager — it realizes the task at configuration time.buildSrc/…/module.gradle.kts:259by tasks.registeringtasks.register("prepareProtocConfigVersions")buildSrc/…/version-to-resources.gradle.kts:47by tasks.registeringtasks.register("createVersionFile")gradle-plugin/build.gradle.kts:62by getting(JvmTestSuite::class)named<JvmTestSuite>("test")gradle-plugin/build.gradle.kts:78val test: Task by tasks.gettingtasks.named("test")gradle-plugin/build.gradle.kts:90by tasks.getting(ShadowJar::class)tasks.named<ShadowJar>("shadowJar")gradle-plugin/build.gradle.kts:198val versionToPublish: String by extraextra["versionToPublish"] as StringThe deprecation text suggests
getByName<Type>(name), but a companion warning in the samegroup says "Use the named() API instead".
namedis the right target —getByNameis eagerand would work against Gradle's configuration-avoidance direction.
The
publishPlugins/publish/ideaModuleconfiguration was collapsed into the singleexisting
tasks { }block, becausepublishPluginshad been configured twice: once via thedeprecated delegate for
enabled, once via the accessor fornotCompatibleWithConfigurationCache.2. Dropped the
ideapluginGenerateIdeaModuleandIdeaPluginare both@Deprecatedin Gradle 9.7 and scheduled forremoval in Gradle 10. In this repo the plugin was applied but never configured, and every
.imlfile on disk lives under.idea/modules/— IntelliJ's own Gradle-import layout, not themodule-root location the Gradle plugin writes to. None are tracked in git, so no committed IDE
metadata depended on its output.
Removed from the root
build.gradle.ktsand frombuildSrc/…/module.gradle.kts. Thenow-dangling
named("ideaModule") { … }block ingradle-plugin/build.gradle.ktshad to gowith it —
named()throws on a missing task — which also retires the configuration-cacheworkaround for gradle#13480.
ideaalso appears inbuildSrc/…/uber-jar-module.gradle.ktsandbuildSrc/…/javascript/plugin/Idea.kt, but both are byte-identical copies distributed by theconfigsubmodule and neither is reachable from this build. They belong in aconfigPR.Notes for the reviewer
--configuration-cacheon the base: both sides report the same 5 pre-existing problems,including the
createVersionFileone, so thetasks.registerconversion introduced nothing../gradlew buildpasses;:api:test,:protoc-plugin:testand:gradle-plugin:testall run.gradlew tasks --allno longer lists anyidea/cleanIdeatask.0.17.2in a separate commit.named("publish")atgradle-plugin/build.gradle.kts:213was switched to the type-safepublish { }accessor, matchingpublishPlugins { }in the same block.🤖 Generated with Claude Code