-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use custom start scripts instead of brittle patch files #639
Conversation
The start scripts are generated by `gradlew startScripts`, and the patch logic hooks up to it via `doLast`. I've updated the _patch_ files by adjusting the `.orig` files as required, and then running `diff -u` on it (from within `build/scripts/`). ``` diff -u TerasologyLauncher.orig TerasologyLauncher > ../../buildres/scripts/TerasologyLauncher.patch ``` After this update, I at least don't see any rejections `.rej` anymore. Contributes to #547
Although this "solves" #547 I don't want to close that issue, as it describes the fact that this patch-workaround is quite brittle and will like break again in the future 🙈 My comment over there still holds - I want to move the launcher to jlink/jpackage rather than maintaining a custom copy of the start scripts. If anybody who understands Gradle a bit better (@keturn 😉) happens to find the time for a PR to add customized scripts that contribution is very welcome. |
// for spf4j dependencies that haven't been merged upstream | ||
// i.e. org.apache.avro:avro | ||
name "spf4j dependencies" | ||
url "https://dl.bintray.com/zolyfarkas/core" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bintray repository is shut down. We've published org.apache.avro:avro:1.9.0.20p
as manual release to our Artifactory.
# Use bundled JRE when available | ||
if [ -d "\$APP_HOME/jre" ] ; then | ||
JAVA_HOME="\$APP_HOME/jre" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only semantic addition to this script.
@rem Use bundled JRE when available | ||
if exist "%APP_HOME%/jre/" set JAVA_HOME="%APP_HOME%/jre/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only semantic addition to this script.
@@ -1,5 +1,5 @@ | |||
distributionBase=GRADLE_USER_HOME | |||
distributionPath=wrapper/dists | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uses the same Gradle version as engine. Used the start script templates from that Gradle version as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Windows 10, gradlew installWindows64Dist
, launched game was using Java: 11.0.8 in D:\Dev\Terasology\Git_WS\TerasologyLauncher\build\install\TerasologyLauncher-windows64\jre
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed that the generated script seems to have only the intended diff when compared to the upstream default. 👍
A note about that avro dependency: The fork has updated its documentation at https://github.com/zolyfarkas/avro and there is a new repo available for those, hosted by GitHub Packages. The disadvantage is that using a GitHub Packages repository requires setting the credentials in your build environment: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry |
Okay, I've ended up going down the path suggested in #547 and adding custom templates based on the default start scripts provided by Gradle to this repo.
They contain a minimal addition to set
JAVA_HOME
local to thejre
folder inAPP_HOME
. That way, the local JRE should be picked up when starting the launcher.How to test
gradlew install...Dist
(with...
beingLinux64
,Windows64
, orMac
) to build the distribution for Windowsbin/TerasologyLauncher.bat
orbin/TerasologyLauncher
Resolves #547
Original PR description:
The start scripts are generated bygradlew startScripts
, and the patch logic hooks up to it viadoLast
. I've updated the patch files by adjusting the.orig
files as required, and then runningdiff -u
on it (from withinbuild/scripts/
).After this update, I at least don't see any rejections.rej
anymore.