Improved linux packaging.

This commit is contained in:
Andrew Lalis 2022-08-07 13:41:16 +02:00
parent 99a1ef3441
commit 19d6dc7a5e
2 changed files with 27 additions and 21 deletions

View File

@ -7,15 +7,14 @@ function join_by {
fi
}
mvn clean package javafx:jlink -DskipDebug=true -DstripJavaDebugAttributes=true -DnoHeaderFiles=true -DnoManPages=true
mvn clean package
cd target
module_jars=(lib/*)
eligible_main_jars=("*jar-with-dependencies.jar")
eligible_main_jars=("*.jar")
main_jar=(${eligible_main_jars[0]})
module_path=$(join_by ";" ${module_jars[@]})
module_path="$main_jar;$module_path"
module_path=$(join_by ":" ${module_jars[@]})
module_path="$main_jar:$module_path"
echo $module_path
jpackage \
--name "Ace of Shades Launcher" \
--app-version "1.0.0" \
@ -24,8 +23,6 @@ jpackage \
--linux-deb-maintainer "andrewlalisofficial@gmail.com" \
--linux-menu-group "Game" \
--linux-app-category "Game" \
--runtime-image image \
--main-jar $main_jar \
--main-class nl.andrewl.aos2_launcher.Launcher \
--input .
--module-path "$module_path" \
--module aos2_launcher/nl.andrewl.aos2_launcher.Launcher

View File

@ -42,17 +42,26 @@ public class EditProfileDialog extends Dialog<Profile> {
.or(usernameField.textProperty().isEmpty());
nameField.setText(profile.getName());
usernameField.setText(profile.getUsername());
VersionFetcher.INSTANCE.getAvailableReleases().thenAccept(releases -> Platform.runLater(() -> {
clientVersionChoiceBox.setItems(FXCollections.observableArrayList(releases.stream().map(ClientVersionRelease::tag).toList()));
// If the profile doesn't have a set version, use the latest release.
if (profile.getClientVersion() == null || profile.getClientVersion().isBlank()) {
String lastRelease = releases.size() == 0 ? null : releases.get(0).tag();
if (lastRelease != null) {
clientVersionChoiceBox.setValue(lastRelease);
}
} else {
clientVersionChoiceBox.setValue(profile.getClientVersion());
}
VersionFetcher.INSTANCE.getAvailableReleases()
.whenComplete((releases, throwable) -> Platform.runLater(() -> {
if (throwable == null) {
clientVersionChoiceBox.setItems(FXCollections.observableArrayList(releases.stream().map(ClientVersionRelease::tag).toList()));
// If the profile doesn't have a set version, use the latest release.
if (profile.getClientVersion() == null || profile.getClientVersion().isBlank()) {
String lastRelease = releases.size() == 0 ? null : releases.get(0).tag();
if (lastRelease != null) {
clientVersionChoiceBox.setValue(lastRelease);
}
} else {
clientVersionChoiceBox.setValue(profile.getClientVersion());
}
} else {
throwable.printStackTrace();
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.initOwner(this.getOwner());
alert.setContentText("An error occurred while fetching the latest game releases: " + throwable.getMessage());
alert.show();
}
}));
jvmArgsTextArea.setText(profile.getJvmArgs());