Skip to content

Bugfix/gradle fixes tweaks#698

Merged
tonihele merged 3 commits into
jMonkeyEngine:masterfrom
tonihele:bugfix/gradle-fixes-tweaks
May 28, 2026
Merged

Bugfix/gradle fixes tweaks#698
tonihele merged 3 commits into
jMonkeyEngine:masterfrom
tonihele:bugfix/gradle-fixes-tweaks

Conversation

@tonihele
Copy link
Copy Markdown
Contributor

Phew, I think finally done. Of course not compatible with Gradle 10 but will do for now. Mostly ChatGPTd it.
image

Resolves #696

Copilot AI review requested due to automatic review settings May 27, 2026 20:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@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 refactors the library copying and XML generation logic in build.gradle. It splits the monolithic copyProjectLibs task into modular, declarative Copy tasks (copyProjectBaseLibraries, copyProjectLibraries, and copyProjectTestData). It also introduces a recursive dependency resolver (buildDependencyResolver) to dynamically resolve transitive dependencies for createProjectXml. The reviewer feedback highlights several key improvement opportunities: avoiding unnecessary disk I/O in file copying tasks by using details.name instead of details.file.name, optimizing the recursive dependency collection to use an accumulator instead of list concatenation, preventing potential malformed XML when jmeJarFiles is empty, and skipping XML generation for self-resolving dependencies that yield no artifacts.

Comment thread build.gradle
libraryWriter << '<!DOCTYPE library PUBLIC "-//NetBeans//DTD Library Declaration 1.0//EN" "http://www.netbeans.org/dtds/library-declaration-1_0.dtd">' << eol
libraryXml.library(version: "1.0", encoding: "UTF-8") {
makeName(libraryXml, "${dep.name}")
makeName(libraryXml, "${name}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

For third-party libraries (where jmeJarFiles is empty), accessing jmeJarFiles[0] on line 489 will return null, resulting in an invalid classpath entry: <resource>jar:nbinst://com.jme3.gde.project.baselibs/libs/null!/</resource>.\n\nTo fix this, the classpath resource for jmeJarFiles[0] should be wrapped in a check to ensure jmeJarFiles is not empty:\n\ngroovy\nif (!jmeJarFiles.isEmpty()) {\n resource "jar:nbinst://com.jme3.gde.project.baselibs/libs/${jmeJarFiles[0]}!/"\n}\n\n\nSince line 489 is outside the modified diff hunk, this cannot be applied via a direct code suggestion, but it should be addressed to avoid generating malformed XML files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this was always the case, I'm sure it is fine

Comment thread build.gradle
Comment thread build.gradle
Comment thread build.gradle
Comment thread build.gradle
Comment thread build.gradle Outdated
@tonihele tonihele merged commit 4f68914 into jMonkeyEngine:master May 28, 2026
4 of 6 checks passed
@tonihele tonihele deleted the bugfix/gradle-fixes-tweaks branch May 28, 2026 14:19
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.

Fix regressions in Gradle build

2 participants