Skip to content

Address Gradle 9.6 API deprecations - #22

Merged
alexander-yevsyukov merged 4 commits into
masterfrom
address-gradle-deprecations
Sep 1, 2026
Merged

alexander-yevsyukov merged 4 commits into
masterfrom
address-gradle-deprecations

Conversation

@alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

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 extra delegate
sugar. getting in particular is eager — it realizes the task at configuration time.

File Before After
buildSrc/…/module.gradle.kts:259 by tasks.registering tasks.register("prepareProtocConfigVersions")
buildSrc/…/version-to-resources.gradle.kts:47 by tasks.registering tasks.register("createVersionFile")
gradle-plugin/build.gradle.kts:62 by getting(JvmTestSuite::class) named<JvmTestSuite>("test")
gradle-plugin/build.gradle.kts:78 val test: Task by tasks.getting tasks.named("test")
gradle-plugin/build.gradle.kts:90 by tasks.getting(ShadowJar::class) tasks.named<ShadowJar>("shadowJar")
gradle-plugin/build.gradle.kts:198 val versionToPublish: String by extra extra["versionToPublish"] as String

The deprecation text suggests getByName<Type>(name), but a companion warning in the same
group says "Use the named() API instead". named is the right target — getByName is eager
and would work against Gradle's configuration-avoidance direction.

The publishPlugins / publish / ideaModule configuration was collapsed into the single
existing tasks { } block, because publishPlugins had been configured twice: once via the
deprecated delegate for enabled, once via the accessor for notCompatibleWithConfigurationCache.

2. Dropped the idea plugin

GenerateIdeaModule and IdeaPlugin are both @Deprecated in Gradle 9.7 and scheduled for
removal in Gradle 10. In this repo the plugin was applied but never configured, and every
.iml file on disk lives under .idea/modules/ — IntelliJ's own Gradle-import layout, not the
module-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.kts and from buildSrc/…/module.gradle.kts. The
now-dangling named("ideaModule") { … } block in gradle-plugin/build.gradle.kts had to go
with it — named() throws on a missing task — which also retires the configuration-cache
workaround for gradle#13480.

idea also appears in buildSrc/…/uber-jar-module.gradle.kts and
buildSrc/…/javascript/plugin/Idea.kt, but both are byte-identical copies distributed by the
config submodule and neither is reachable from this build. They belong in a config PR.

Notes for the reviewer

  • Verified no regression in configuration-cache behaviour. Stashed and re-ran
    --configuration-cache on the base: both sides report the same 5 pre-existing problems,
    including the createVersionFile one, so the tasks.register conversion introduced nothing.
  • ./gradlew build passes; :api:test, :protoc-plugin:test and :gradle-plugin:test all run.
  • gradlew tasks --all no longer lists any idea / cleanIdea task.
  • Dependency reports regenerated for 0.17.2 in a separate commit.
  • named("publish") at gradle-plugin/build.gradle.kts:213 was switched to the type-safe
    publish { } accessor, matching publishPlugins { } in the same block.

🤖 Generated with Claude Code

alexander-yevsyukov and others added 3 commits September 1, 2026 14:43
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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-01T14:36:51.295481Z 7b1ffff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Sep 1, 2026
@alexander-yevsyukov alexander-yevsyukov self-assigned this Sep 1, 2026
@alexander-yevsyukov alexander-yevsyukov moved this from 🏗 In progress to In Review in v2.0 Sep 1, 2026
@codecov

codecov Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 14.40%. Comparing base (ae7be0c) to head (477bb90).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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>
@alexander-yevsyukov
alexander-yevsyukov merged commit 8711b79 into master Sep 1, 2026
9 checks passed
@alexander-yevsyukov
alexander-yevsyukov deleted the address-gradle-deprecations branch September 1, 2026 16:21
@github-project-automation github-project-automation Bot moved this from In Review to ✅ Done in v2.0 Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants