Skip to content

build: clear Gradle 10 deprecations, bump wrapper to 9.7.1 - #5362

Open
soloturn wants to merge 3 commits into
developfrom
fix/kotlin-transformer-bound
Open

build: clear Gradle 10 deprecations, bump wrapper to 9.7.1#5362
soloturn wants to merge 3 commits into
developfrom
fix/kotlin-transformer-bound

Conversation

@soloturn

@soloturn soloturn commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

AI-assisted change proposal. Filed by agent driven by @soloturn via GDD.

Summary

Gradle 10 deprecations — 100 warnings before, 39 after

  • modules/build.gradle.kts passed the Project object itself to api(), once per subproject. Using a Project as dependency notation fails with an error in Gradle 10; it now depends on project(path).
  • GradleDependencyInfo.asMap() produced the group:/name:/version: map form, which terasology-module.gradle.kts applies to every module. Multi-string notation also fails in Gradle 10, so it now produces single-string "group:module:version". Version ranges are unaffected — they contain no colons, so the coordinate still splits unambiguously.
  • config/gradle/publish.gradle read publishRepo/mavenUser/mavenPass as bare names, an implicit lookup in a parent project. These sit inside hasProperty guards, so they would have broken publishing rather than building.
  • Everything still reported after this change traces into libs/gestalt or libs/TeraNUI. Those are independent repos reached via includeBuild and need their own PRs; nothing here can fix them. The module-attributed warnings were never the module repos' fault either — every modules/*/build.gradle is byte-identical to templates/build.gradle and only applies terasology-module, so those were this repo's build-logic reported once per project.
  • Left alone deliberately: the protoc coordinate warning attributed to :engine is emitted inside protobuf-gradle-plugin 0.9.4's own ToolsLocator, which tokenizes the single-string coordinate we hand it and re-assembles it as a map. engine/build.gradle.kts:157 is already correct single-string notation; that one needs a plugin upgrade, which belongs in its own change.

Getting to a Gradle that reports them

  • Seeing those warnings at all means running 9.7.1, which this build could not do. Gradle 9.7.1 ships Kotlin 2.4, which enforces Transformer's declared OUT : Any bound. ContentFilterable.filter takes Transformer<String?, String> — the OUT is nullable because returning null there drops the line — so naming that type is a compile error (KTLC-358), and facades/PC/build.gradle.kts named it twice: implementing the interface, and casting to it. The net effect is that Gradle's own API is not implementable from the Kotlin that Gradle ships with. Passing a lambda instead lets SAM conversion supply the type argument, so the script never names it; ScriptClasspathRewriter keeps its logic and never returned null anyway.
  • On 9.6.1 Kotlin only warns ("will become an error in language version 2.5"), so this was a prerequisite for the bump rather than a consequence of it. Anyone already running a system Gradle 9.7.1 currently cannot configure this build at all.
  • Only distributionUrl moves. The wrapper jar and gradlew scripts are left untouched — they are just the bootstrapper, and the existing ones drive 9.7.1 fine (verified), so regenerating them would be pure diff noise. Staying on -bin too: the wrapper task would have switched it to -all, making every CI run additionally download sources and docs.

Test plan

All run through the repo's existing (unmodified) gradlew, which picks up 9.7.1 from the bumped distributionUrl, on JDK 21.

  • ./gradlew compileJava — whole build configures and compiles, including facades/PC and all 55 modules. This is the step that fails outright before the change under Gradle 9.7.1.
  • ./gradlew unitTest — passes across all modules.
  • ./gradlew :engine:check :engine-tests:check :facades:PC:check -x test — checkstyle, PMD and SpotBugs clean; only the pre-existing findings in test sources, unchanged.
  • ./gradlew :facades:PC:testDistForLauncher — passes. This is the behavioural check for the Kotlin change: it builds the launcher distribution and asserts the rewritten lib/libs/ paths, which is exactly what ScriptClasspathRewriter produces.
  • ./gradlew :modules:reportModuleOrder — all 55 modules still resolve and topologically sort. This is the behavioural check for the asMap() → single-string change, since it exercises the dependency graph that change feeds.
  • ./gradlew --warning-mode all help — 100 Gradle deprecation warnings before, 39 after, none of the remainder in files this repo tracks.

Related

  • None.

@github-actions github-actions Bot added the Category: Build/CI Requests, Issues and Changes targeting gradle, groovy, Jenkins, etc. label Aug 16, 2026
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4cdd3fd9-9474-42c8-8de7-63684750f7e2

📥 Commits

Reviewing files that changed from the base of the PR and between 9517280 and ded3e8b.

📒 Files selected for processing (1)
  • gradle/wrapper/gradle-wrapper.properties
🚧 Files skipped from review as they are similar to previous changes (1)
  • gradle/wrapper/gradle-wrapper.properties

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Build and Release Improvements
    • Updated Gradle build tooling to version 9.7.1.
    • Improved dependency handling across module, platform, and protobuf builds.
    • Preserved publishing repository and credential configuration.
    • Maintained launcher script path rewriting during packaging.
    • Streamlined module metadata processing and platform dependency registration.

Walkthrough

The build configuration now uses dependency notation strings, explicit subproject paths, root-project publishing properties, direct version provider values, and a standalone script rewriter. The Gradle wrapper updates to version 9.7.1.

Changes

Build tooling

Layer / File(s) Summary
Dependency notation and module wiring
build-logic/src/main/kotlin/org/terasology/gradology/module_build.kt, build-logic/src/main/kotlin/terasology-module.gradle.kts, modules/build.gradle.kts
GradleDependencyInfo returns group:module:version notation. Module dependencies and subproject API dependencies use explicit Gradle project references.
Publishing and packaging integration
config/gradle/publish.gradle, facades/PC/build.gradle.kts
Publishing reads repository and credential values through rootProject.property(...). The packaging filter invokes ScriptClasspathRewriter.rewrite.
Compiler dependency configuration
engine/build.gradle.kts, engine-tests/build.gradle.kts
Protobuf version providers are used directly. The build scripts suppress unchecked casts for parsed module configuration.
Gradle wrapper version
gradle/wrapper/gradle-wrapper.properties
The wrapper distribution updates from Gradle 9.6.1 to Gradle 9.7.1.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to ded3e

The change updates Gradle compatibility and build configuration, with the supplied build and validation checks passing; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: benjaminamos

Poem

A rabbit checks each build detail,
Dependency strings now stay concise.
Project paths resolve in line,
Publishing reads properties fine.
The wrapper hops to nine-seven-one.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main changes: resolving Gradle 10 deprecations and updating the Gradle wrapper.
Description check ✅ Passed The description directly explains the Gradle compatibility changes, wrapper update, remaining warnings, and test results.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/kotlin-transformer-bound

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@soloturn
soloturn force-pushed the fix/kotlin-transformer-bound branch 2 times, most recently from 92432a8 to ed47b61 Compare August 16, 2026 13:59
@soloturn soloturn changed the title build: bump wrapper to Gradle 9.7.0, clear the blockers and deprecations build: clear Gradle 10 deprecations, bump wrapper to 9.7.0 Aug 16, 2026
Comment thread modules/build.gradle.kts Outdated
soloturn added a commit that referenced this pull request Aug 18, 2026
Addresses review confusion on #5362: the bare `it` in
subprojects.forEach { api(project(it.path)) } reads ambiguously and
was mistaken for a self-dependency. Verified via
'gradlew :modules:dependencies --configuration api' both before and
after - each of the 54 subprojects is declared exactly once, no
self-reference to :modules.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@soloturn
soloturn requested a review from BenjaminAmos August 18, 2026 18:28
@soloturn soloturn changed the title build: clear Gradle 10 deprecations, bump wrapper to 9.7.0 build: clear Gradle 10 deprecations, bump wrapper to 9.7.1 Aug 21, 2026
soloturn and others added 3 commits August 21, 2026 22:46
Gradle reports 100 deprecation warnings "making it incompatible with
Gradle 10". Three of the sites are ours, and between them account for 61
of the 100:

- modules/build.gradle.kts passed the Project object itself to api(),
  once per subproject. Using a Project as dependency notation fails with
  an error in Gradle 10; it now depends on project(path).

- GradleDependencyInfo.asMap() produced the group:/name:/version: map
  form, which terasology-module.gradle.kts applies to every module.
  Multi-string notation also fails in Gradle 10, so it now produces
  single-string "group:module:version". Version ranges are unaffected -
  they contain no colons, so the coordinate still splits unambiguously.

- config/gradle/publish.gradle read publishRepo/mavenUser/mavenPass as
  bare names, an implicit lookup in a parent project. Those sit inside
  hasProperty guards, so they would have broken publishing, not building.

Every remaining warning traces into libs/gestalt or libs/TeraNUI, which
are independent repos reached through includeBuild and need their own
PRs. The module-attributed ones were never the module repos' fault:
every modules/*/build.gradle is byte-identical to templates/build.gradle
and only applies terasology-module, so those were this repo's
build-logic reported once per project.

Not addressed: the protoc coordinate warning attributed to :engine comes
from protobuf-gradle-plugin 0.9.4's own ToolsLocator, which tokenizes the
single-string coordinate we give it and rebuilds it as a map.
engine/build.gradle.kts is already correct; that needs a plugin upgrade.

Seeing those warnings at all means running 9.7.1, which this build could
not do. Gradle 9.7.1 ships Kotlin 2.4, which enforces Transformer's
declared OUT : Any bound. ContentFilterable.filter takes
Transformer<String?, String> - the OUT is nullable because returning null
there drops the line - so naming that type is now a compile error
(KTLC-358), and facades/PC named it twice: implementing the interface,
and casting to it. The net effect is that Gradle's own API is not
implementable from the Kotlin that Gradle ships with. Passing a lambda
instead lets SAM conversion supply the type argument, so the script never
names it; ScriptClasspathRewriter keeps its logic and never returned null
anyway.

Only distributionUrl moves. The wrapper jar and gradlew scripts are left
alone - they are just the bootstrapper, and the existing ones drive 9.7.1
fine, so regenerating them would be diff noise. Staying on -bin too: the
wrapper task would have switched it to -all, making every CI run
additionally download sources and docs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
engine/build.gradle.kts and engine-tests/build.gradle.kts each called
.toString() on libs.versions.protobuf.get(), which already returns
String - kotlinc flagged both as a redundant conversion.

Both also cast JsonSlurper().parseText()'s Any! result straight to
Map<String, String> to read module.txt; kotlinc can't verify that at
runtime, hence the unchecked-cast warning. Suppressed rather than
restructured - module.txt's shape is fixed and this mirrors how the
Kotlin stdlib itself documents suppressing verified-safe erasure casts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Addresses review confusion on #5362: the bare `it` in
subprojects.forEach { api(project(it.path)) } reads ambiguously and
was mistaken for a self-dependency. Verified via
'gradlew :modules:dependencies --configuration api' both before and
after - each of the 54 subprojects is declared exactly once, no
self-reference to :modules.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@soloturn
soloturn force-pushed the fix/kotlin-transformer-bound branch from ded3e8b to 1a70dae Compare August 21, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Build/CI Requests, Issues and Changes targeting gradle, groovy, Jenkins, etc.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants