Skip to content

Prepare Gradle build scripts for Gradle 10#5

Merged
lagergren merged 1 commit into
masterfrom
prepare-gradle-10
Jul 6, 2026
Merged

Prepare Gradle build scripts for Gradle 10#5
lagergren merged 1 commit into
masterfrom
prepare-gradle-10

Conversation

@lagergren

Copy link
Copy Markdown
Contributor

Follow-up to the Gradle 9.6.1 upgrade (#4, already merged): remove the Kotlin DSL property-delegate syntax that Gradle 9.6.1 deprecates and Gradle 10 removes, so the build is Gradle-10-ready and warning-free. Same change as xtclang/xvm#494.

Changes

  • hello-xtc/build.gradle.kts: val printVersionInfo by tasks.registering { } and val greet by tasks.registering { }val x = tasks.register("x") { }.
  • hello-xtc/build.gradle.kts + settings.gradle.kts: the localOnly property reads (val localOnly: String by project / by settings) → providers.gradleProperty("localOnly").get(). localOnly=false is always defined in gradle.properties, so .get() preserves the previous fail-fast behavior and the existing providers.gradleProperty(...) idiom already used in this file.

Verification

  • ./gradlew build --warning-mode fail — BUILD SUCCESSFUL with no deprecation warnings (the flag fails the build on any deprecation).
  • No by tasks/configurations/settings/project/extra delegate declarations remain.

Gradle 9.6.1 deprecates the Kotlin DSL property-delegate syntax (removal in
Gradle 10):
- `val x by tasks.registering { }`  -> `val x = tasks.register("x") { }`
- `val x: String by settings`        -> `providers.gradleProperty("x").get()`
- `val x: String by project`         -> `providers.gradleProperty("x").get()`

Switch the task declarations in hello-xtc and the localOnly property reads in
settings.gradle.kts / hello-xtc/build.gradle.kts to the recommended APIs,
matching xtclang/xvm#494. localOnly is always defined in gradle.properties, so
.get() preserves the previous fail-fast behavior.

Verified: `./gradlew build --warning-mode fail` is BUILD SUCCESSFUL with no
deprecation warnings.
@lagergren
lagergren merged commit 5aaf9b7 into master Jul 6, 2026
1 check passed
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.

1 participant