Skip to content

Clean up Gradle build warnings#2700

Draft
8Keep wants to merge 1 commit intojMonkeyEngine:masterfrom
8Keep:gradle-build-review
Draft

Clean up Gradle build warnings#2700
8Keep wants to merge 1 commit intojMonkeyEngine:masterfrom
8Keep:gradle-build-review

Conversation

@8Keep
Copy link
Copy Markdown
Contributor

@8Keep 8Keep commented Apr 8, 2026

Cleaning up gradle build files to prepare for a new version of gradle.

Most of this is migrating to the lazy tasks apis.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modernizes the Gradle build system by migrating to the Task Configuration Avoidance API, refactoring native library handling with the Sync task, and updating dependency management across several modules. Key feedback includes concerns about potential Javadoc build failures after removing lint suppression, the inclusion of unused variables and empty tasks, and recommendations to adhere to Gradle best practices regarding lazy evaluation and logging.

build.gradle Outdated
}

task run(dependsOn: ':jme3-examples:run') {
def runTask = tasks.register('run') {
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.

medium

The variable runTask is assigned the result of tasks.register but is never used. You can register the task without assigning it to a variable.

tasks.register('run') {

build.gradle Outdated
dependsOn cleanMergedJavadoc
}

tasks.register('mergedSource', Copy)
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.

medium

The mergedSource task is empty and does not appear to be used anywhere in the build scripts. It should be removed to clean up dead code.

build.gradle Outdated
Comment on lines +213 to +214
zipFile: layout.buildDirectory.file("${nativesSnapshot}-natives.zip").get().asFile,
nativeDir: layout.buildDirectory.dir("native").get().asFile,
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.

medium

Calling .get() on a Provider (like layout.buildDirectory.file(...)) during the configuration phase is discouraged as it can break configuration caching and other lazy evaluation benefits. It is better to pass the Provider directly where possible, or only call .get() during the execution phase (e.g., inside a doFirst block or when resolving a value for an external tool like ant.get).

@8Keep 8Keep force-pushed the gradle-build-review branch 2 times, most recently from 37931dd to c3e8bf7 Compare April 8, 2026 05:06
@8Keep 8Keep force-pushed the gradle-build-review branch from c3e8bf7 to 28e09c0 Compare April 8, 2026 05:28
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