From 871419a4c77d0ea0019ff83497c6f1bd86f8b95b Mon Sep 17 00:00:00 2001 From: Dave Hadka Date: Mon, 25 Dec 2023 09:04:49 -0700 Subject: [PATCH] Create platform-independent bundle --- .github/workflows/package.yml | 25 ++++++++++++- pom.xml | 59 ++++++------------------------ src/packaging/j3 | 9 +++++ src/packaging/j3.bat | 11 ++++++ src/packaging/linux-jpackage.txt | 7 +++- src/packaging/osx-jpackage.txt | 7 +++- src/packaging/windows-jpackage.txt | 23 ++++++------ 7 files changed, 78 insertions(+), 63 deletions(-) create mode 100644 src/packaging/j3 create mode 100644 src/packaging/j3.bat diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 25b1d94..9b9ea33 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -21,10 +21,10 @@ jobs: java-package: 'jdk+fx' cache: 'maven' - - name: Maven build + - name: Build native installer run: mvn clean install - - name: Upload release + - name: Upload native installer uses: actions/upload-artifact@v4 with: name: J3-${{ runner.os }} @@ -32,3 +32,24 @@ jobs: ./target/*.msi ./target/*.dmg ./target/*.deb + + - name: Create platform-independent bundle + if: runner.os == 'Linux' + run: | + pushd target + mkdir J3 + cp -r lib/ J3 + cp -r runtime/ J3 + cp -r ../data J3 + cp -r ../animations J3 + cp ../src/packaging/j3.bat J3 + cp ../src/packaging/j3 J3 + chmod +x J3/j3 + + - name: Upload platform-independent bundle + if: runner.os == 'Linux' + uses: actions/upload-artifact@v4 + with: + name: J3 + path: | + ./target/J3 diff --git a/pom.xml b/pom.xml index fb826e1..0ea86a8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ j3 2.0.0 J3 - Java 3D Visualization Tool - + @@ -15,8 +15,10 @@ J3 ${project.version} + Copyright 2009-2023 + Project-Platypus j3.GUI - + javafx.controls,java.logging,java.prefs @@ -24,7 +26,6 @@ UTF-8 e110edba-dbba-4f28-9c9b-ec09ad39522c - Project-Platypus @@ -84,7 +85,7 @@ kr.motd.maven os-maven-plugin - 1.7.0 + 1.7.1 @@ -102,7 +103,7 @@ org.apache.maven.plugins maven-install-plugin - 3.0.0-M1 + 3.1.1 true @@ -110,7 +111,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.3.0 + 3.6.1 prepare-package @@ -127,7 +128,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0 ${project.build.directory}/lib @@ -153,10 +154,10 @@ jlink - ${project.build.directory}/jvm-image/ + ${project.build.directory}/runtime/ ${javafx.home} ${jvm.modules} - ${project.build.directory}/jvm-image + ${project.build.directory}/runtime --strip-native-commands --no-header-files @@ -186,46 +187,8 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.12.1 - - - - desktop - - host - - - true - - - - android - - android - - - - ios - - ios - - - - web - - web - - - - - - - gluon-releases - https://nexus.gluonhq.com/nexus/content/repositories/releases/ - - - diff --git a/src/packaging/j3 b/src/packaging/j3 new file mode 100644 index 0000000..c4548e3 --- /dev/null +++ b/src/packaging/j3 @@ -0,0 +1,9 @@ +#!/bin/bash + +pushd runtime +JAVA_HOME=$(pwd) +popd + +PATH=${JAVA_HOME}/bin:${PATH} + +java --class-path "lib/*" j3.GUI diff --git a/src/packaging/j3.bat b/src/packaging/j3.bat new file mode 100644 index 0000000..3ac2e39 --- /dev/null +++ b/src/packaging/j3.bat @@ -0,0 +1,11 @@ +@echo off + +set JAVA_HOME= + +pushd runtime +set JAVA_HOME=%cd% +popd + +set PATH=%JAVA_HOME%\bin;%PATH% + +java --class-path "lib/*" j3.GUI diff --git a/src/packaging/linux-jpackage.txt b/src/packaging/linux-jpackage.txt index 8208c81..a1e6b4f 100644 --- a/src/packaging/linux-jpackage.txt +++ b/src/packaging/linux-jpackage.txt @@ -1,11 +1,16 @@ +--type deb --name ${app.name} --icon "${project.basedir}/src/packaging/appicon.png" +--description "${project.description}" +--copyright "${app.copyright} ${app.vendor}" +--license-file ${project.basedir}/COPYING +--vendor ${app.vendor} --dest "${project.build.directory}" --main-jar ${project.build.finalName}.jar --main-class ${main-class} --input "${project.build.directory}/lib" --app-version ${app.version} ---runtime-image "${project.build.directory}/jvm-image" +--runtime-image "${project.build.directory}/runtime" --temp "${project.build.directory}/installer-work" --app-content "${project.basedir}/data" --app-content "${project.basedir}/animations" diff --git a/src/packaging/osx-jpackage.txt b/src/packaging/osx-jpackage.txt index a4819fa..cbe721a 100644 --- a/src/packaging/osx-jpackage.txt +++ b/src/packaging/osx-jpackage.txt @@ -1,11 +1,16 @@ +--type dmg --name ${app.name} --icon "${project.basedir}/src/packaging/appicon.icns" +--description "${project.description}" +--copyright "${app.copyright} ${app.vendor}" +--license-file ${project.basedir}/COPYING +--vendor ${app.vendor} --dest "${project.build.directory}" --main-jar ${project.build.finalName}.jar --main-class ${main-class} --input "${project.build.directory}/lib" --app-version ${app.version} ---runtime-image "${project.build.directory}/jvm-image" +--runtime-image "${project.build.directory}/runtime" --temp "${project.build.directory}/installer-work" --app-content "${project.basedir}/data" --app-content "${project.basedir}/animations" diff --git a/src/packaging/windows-jpackage.txt b/src/packaging/windows-jpackage.txt index f159e71..889bfdd 100644 --- a/src/packaging/windows-jpackage.txt +++ b/src/packaging/windows-jpackage.txt @@ -1,21 +1,22 @@ --type msi --name ${app.name} ---win-menu ---win-menu-group ${windows.vendor} ---win-dir-chooser ---win-shortcut ---license-file ${project.basedir}/COPYING ---vendor ${windows.vendor} --icon "${project.basedir}/src/packaging/appicon.ico" +--description "${project.description}" +--copyright "${app.copyright} ${app.vendor}" +--license-file ${project.basedir}/COPYING +--vendor ${app.vendor} --dest "${project.build.directory}" --main-jar ${project.build.finalName}.jar --main-class ${main.class} --input "${project.build.directory}/lib" --app-version ${app.version} ---runtime-image "${project.build.directory}/jvm-image" +--runtime-image "${project.build.directory}/runtime" --temp "${project.build.directory}/installer-work" ---win-upgrade-uuid ${windows.upgrade.uuid} ---description "${project.description}" ---copyright "Copyright ${windows.vendor}" --app-content "${project.basedir}/data" ---app-content "${project.basedir}/animations" \ No newline at end of file +--app-content "${project.basedir}/animations" +--win-menu +--win-menu-group ${vendor} +--win-dir-chooser +--win-shortcut +--win-shortcut-prompt +--win-upgrade-uuid ${windows.upgrade.uuid}