Skip to content

Adopt Gradle best practices - #543

Open
MartelliEnrico wants to merge 4 commits into
mainfrom
gradle-9.7-best-practices
Open

Adopt Gradle best practices#543
MartelliEnrico wants to merge 4 commits into
mainfrom
gradle-9.7-best-practices

Conversation

@MartelliEnrico

@MartelliEnrico MartelliEnrico commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores

    • Updated the build configuration and Java runtime setup.
    • Improved application packaging and generated launch scripts for supported platforms.
    • Enabled isolated project support for more streamlined builds.
    • Updated toolchain resolution and modernised build configuration syntax.
  • Tests

    • Configured tests to run in a randomised order, helping identify order-dependent issues.

No changes to the application’s user-facing features or functionality.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The Gradle build now uses Kotlin DSL configuration, Java 26 toolchains, isolated projects, jlink runtime generation, runtime-backed tests, and custom application packaging. JlinkTask now accepts only ProjectLayout and exposes its compiler property publicly.

Changes

Gradle build and runtime configuration

Layer / File(s) Summary
Project and toolchain setup
build.gradle.kts, settings.gradle.kts, gradle.properties, buildSrc/build.gradle.kts
The Kotlin DSL configures project plugins, dependencies, repositories, Java 26 toolchains, Foojay resolution, project naming, and isolated-projects support.
Runtime, test, and distribution configuration
build.gradle.kts, src/test/resources/junit-platform.properties
The build creates a minimal jlink runtime, runs tests with that runtime, enables nullability checks and random JUnit ordering, generates compact object headers, packages the runtime in distributions, and applies custom start-script templates.
JlinkTask compiler API
buildSrc/src/main/java/com/github/stickerifier/stickerify/JlinkTask.java
JlinkTask exposes its Java compiler property publicly and accepts only ProjectLayout. It no longer resolves the compiler through JavaToolchainService.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarises the Gradle configuration migration and adoption of updated Gradle build practices.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
build.gradle.kts (1)

4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the public Gradle task API.

DaemonJvmPropertiesConfigurator is an internal Gradle type. It has no compatibility guarantee. Configure UpdateDaemonJvm with the public task name "updateDaemonJvm" instead. Gradle documents this public configuration method. (docs.gradle.org)

Proposed fix
-import org.gradle.internal.buildconfiguration.DaemonJvmPropertiesConfigurator
...
-tasks.named<UpdateDaemonJvm>(DaemonJvmPropertiesConfigurator.TASK_NAME) {
+tasks.named<UpdateDaemonJvm>("updateDaemonJvm") {

Also applies to: 43-46


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e6b0568c-b438-431b-a874-807f9767f60a

📥 Commits

Reviewing files that changed from the base of the PR and between ff6f975 and 8539732.

📒 Files selected for processing (5)
  • build.gradle
  • build.gradle.kts
  • buildSrc/build.gradle.kts
  • settings.gradle
  • settings.gradle.kts
💤 Files with no reviewable changes (2)
  • settings.gradle
  • build.gradle

Comment thread build.gradle.kts Outdated
@rob93c rob93c changed the title Gradle 9.7 best practices Adopt Gradle best practices Aug 8, 2026
@rob93c rob93c added enhancement New feature or request unit test This marks issues revolving around unit tests labels Aug 8, 2026
@rob93c
rob93c self-requested a review August 8, 2026 17:12

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/test/resources/junit-platform.properties (1)

1-2: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Make random test execution reproducible.

ClassOrderer.Random and MethodOrderer.Random use System.nanoTime() as the default seed when no seed is set, so class and method ordering can differ between runs. Set junit.jupiter.execution.order.random.seed in Gradle or CI when random ordering is required, and include the seed value in test output reports.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ecde4dc4-3cc3-4a42-82d7-da989d9809e6

📥 Commits

Reviewing files that changed from the base of the PR and between 8539732 and 1134b0c.

📒 Files selected for processing (2)
  • build.gradle.kts
  • src/test/resources/junit-platform.properties
🚧 Files skipped from review as they are similar to previous changes (1)
  • build.gradle.kts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request unit test This marks issues revolving around unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants