diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml
index 5951c03..68e4390 100644
--- a/.github/workflows/package.yml
+++ b/.github/workflows/package.yml
@@ -2,96 +2,33 @@ name: Package
on:
push:
- branches: [ master ]
+ workflow_dispatch:
jobs:
- java:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - uses: actions/setup-java@v4
- with:
- distribution: 'zulu'
- java-version: '17'
-
- - name: Maven Package
- run: mvn -Pdesktop package
-
- - name: Create distribution
- run: |
- mkdir staging
- mkdir staging/J3
- cp -r target/lib/ staging/J3/lib
- cp target/j3-*.jar staging/J3/lib
- cp -r data/ staging/J3/data
- cp -r animations staging/J3/animations
- cp package/* staging/J3
-
- - name: Upload
- uses: actions/upload-artifact@v4
- with:
- name: J3
- path: staging
-
- native:
+ package:
strategy:
matrix:
- include:
- - name: Windows
- os: windows-latest
- profile: desktop
- path: x86_64-windows
- exe: j3.exe
- - name: Linux
- os: ubuntu-latest
- profile: desktop
- path: x86_64-linux
- exe: j3
+ os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- - name: Add msbuild to PATH (Windows)
- if: runner.os == 'Windows'
- uses: microsoft/setup-msbuild@v1.1
-
- - name: Visual Studio shell (Windows)
- if: runner.os == 'Windows'
- uses: egor-tensin/vs-shell@v2
-
- - name: Install dependencies (Linux)
- if: runner.os == 'Linux'
- run: |
- sudo apt update
- sudo apt install libasound2-dev libavcodec-dev libavformat-dev libavutil-dev libgl-dev libgtk-3-dev libpango1.0-dev libxtst-dev
-
- - name: Setup Gluon's GraalVM
- uses: gluonhq/setup-graalvm@master
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
- #- name: Gluon License
- # uses: gluonhq/gluon-build-license@v1
- # with:
- # gluon-license: ${{ secrets.GLUON_LICENSE }}
-
- - name: Maven Package
- run: mvn -P${{ matrix.profile }} package
+ - name: Set up JDK 17
+ uses: actions/setup-java@v2
+ with:
+ java-version: 18.0.2
+ distribution: 'zulu'
+ java-package: 'jdk+fx'
+ cache: 'maven'
- - name: Gluon Build and Package
- run: mvn -P${{ matrix.profile }} gluonfx:build gluonfx:package
-
- - name: Create distribution
- run: |
- mkdir staging
- mkdir staging/J3
- cp target/gluonfx/${{ matrix.path }}/${{ matrix.exe }} staging/J3
- cp -r data/ staging/J3/data
- cp -r animations staging/J3/animations
+ - name: Maven build
+ run: mvn clean install
- - name: Upload
+ - name: Upload release
uses: actions/upload-artifact@v4
with:
- name: J3-${{ matrix.name }}
- path: staging
+ name: J3-${{ runner.os }}
+ path: |
+ ./target/*.msi
+ ./target/*.dmg
+ ./target/*.deb
diff --git a/package/README.md b/package/README.md
deleted file mode 100644
index 15a4dc6..0000000
--- a/package/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# J3 - 3D Interactive Visualization in Java
-
-## Prerequisites
-
-1. Download and install Java 17+
-2. Download and install JavaFX SDK - https://gluonhq.com/products/javafx/
-3. Set the environment variables `JAVA_HOME` and `JAVAFX_HOME`
-
-## Usage
-
-Either use the provided `j3` command to run the application or launch from the terminals with:
-
-```bash
-
-# Windows
-java --module-path %JAVAFX_HOME%\lib --add-modules javafx.controls --class-path "lib/*" j3.GUI
-
-# Linux
-java --module-path ${JAVAFX_HOME}\lib --add-modules javafx.controls --class-path "lib/*" j3.GUI
-```
\ No newline at end of file
diff --git a/package/j3 b/package/j3
deleted file mode 100644
index ce716db..0000000
--- a/package/j3
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-if [ -z "${JAVAFX_HOME}" ]; then
- echo "JAVAFX_HOME environment variable must be set!"
- exit -1
-fi
-
-java --module-path ${JAVAFX_HOME}\lib --add-modules javafx.controls --class-path "lib/*" j3.GUI
\ No newline at end of file
diff --git a/package/j3.bat b/package/j3.bat
deleted file mode 100644
index d5c78dd..0000000
--- a/package/j3.bat
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-
-if not defined JAVAFX_HOME echo JAVAFX_HOME environment variable must be set!
-
-java --module-path %JAVAFX_HOME%\lib --add-modules javafx.controls --class-path "lib/*" j3.GUI
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 29478c0..f21c534 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,16 +5,25 @@
org.j3
j3
2.0.0
+ J3 - Java 3D Visualization Tool
- UTF-8
17
21
- 0.0.8
- 1.0.22
- 6.2.2
- 4.0.16
+
+ J3
+ ${project.version}
j3.GUI
+ javafx.controls,java.logging,java.prefs
+
+ UTF-8
+
+ e110edba-dbba-4f28-9c9b-ec09ad39522c
+ Project-Platypus
+
+
+
+
@@ -66,11 +75,31 @@
+
+
+ kr.motd.maven
+ os-maven-plugin
+ 1.7.0
+
+
+
+
+ ${project.basedir}/src/packaging
+ true
+ ${project.build.directory}/packaging
+
+
+ ${project.basedir}/src/main/resources
+ true
+
+
org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
+ maven-install-plugin
+
+ true
+
maven-dependency-plugin
@@ -88,33 +117,67 @@
- org.openjfx
- javafx-maven-plugin
- ${javafx.plugin.version}
+ org.apache.maven.plugins
+ maven-jar-plugin
- ${main.class}
+ ${project.build.directory}/lib
- com.gluonhq
- gluonfx-maven-plugin
- ${gluonfx.plugin.version}
+ org.openjfx
+ javafx-maven-plugin
+ 0.0.8
- ${gluonfx.target}
${main.class}
- --report-unsupported-elements-at-runtime
-
- com.sun.prism.shader.Solid_TextureRGB_AlphaTest_Loader
-
-
- .*\\.properties$
- .*\\.cmap$
-
-
- Project-Platypus
-
+
+ io.github.wiverson
+ jtoolprovider-plugin
+ 1.0.34
+
+
+ jlink
+ package
+
+ java-tool
+
+
+ jlink
+ ${project.build.directory}/jvm-image/
+ ${jvm.modules}
+
+
+ --strip-native-commands
+ --no-header-files
+ --strip-debug
+ --no-man-pages
+ --compress=2
+
+
+
+
+ jpackage
+ install
+
+ java-tool
+
+
+ jpackage
+ true
+ true
+ true
+ ${project.build.directory}/installer-work
+ @${project.build.directory}/packaging/${os.detected.name}-jpackage.txt
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
diff --git a/src/main/java/j3/colormap/impl/inferno.cmap b/src/main/resources/j3/colormap/impl/inferno.cmap
similarity index 100%
rename from src/main/java/j3/colormap/impl/inferno.cmap
rename to src/main/resources/j3/colormap/impl/inferno.cmap
diff --git a/src/main/java/j3/colormap/impl/magma.cmap b/src/main/resources/j3/colormap/impl/magma.cmap
similarity index 100%
rename from src/main/java/j3/colormap/impl/magma.cmap
rename to src/main/resources/j3/colormap/impl/magma.cmap
diff --git a/src/main/java/j3/colormap/impl/plasma.cmap b/src/main/resources/j3/colormap/impl/plasma.cmap
similarity index 100%
rename from src/main/java/j3/colormap/impl/plasma.cmap
rename to src/main/resources/j3/colormap/impl/plasma.cmap
diff --git a/src/main/java/j3/colormap/impl/viridis.cmap b/src/main/resources/j3/colormap/impl/viridis.cmap
similarity index 100%
rename from src/main/java/j3/colormap/impl/viridis.cmap
rename to src/main/resources/j3/colormap/impl/viridis.cmap
diff --git a/src/packaging/appicon.icns b/src/packaging/appicon.icns
new file mode 100644
index 0000000..0a91cf6
Binary files /dev/null and b/src/packaging/appicon.icns differ
diff --git a/src/packaging/appicon.ico b/src/packaging/appicon.ico
new file mode 100644
index 0000000..0cb869e
Binary files /dev/null and b/src/packaging/appicon.ico differ
diff --git a/src/packaging/appicon.png b/src/packaging/appicon.png
new file mode 100644
index 0000000..f1fb706
Binary files /dev/null and b/src/packaging/appicon.png differ
diff --git a/src/packaging/linux-jpackage.txt b/src/packaging/linux-jpackage.txt
new file mode 100644
index 0000000..21feb7f
--- /dev/null
+++ b/src/packaging/linux-jpackage.txt
@@ -0,0 +1,11 @@
+--name ${app.name}
+--icon "${project.basedir}/appicon.png"
+--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"
+--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
new file mode 100644
index 0000000..4deccb8
--- /dev/null
+++ b/src/packaging/osx-jpackage.txt
@@ -0,0 +1,13 @@
+--name ${app.name}
+--icon "${project.basedir}/appicon.icns"
+--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"
+--temp "${project.build.directory}/installer-work"
+--app-content "${project.basedir}/data"
+--app-content "${project.basedir}/animations"
+${macos.sign}
+${macos.sign.identity}
diff --git a/src/packaging/windows-jpackage.txt b/src/packaging/windows-jpackage.txt
new file mode 100644
index 0000000..e15f693
--- /dev/null
+++ b/src/packaging/windows-jpackage.txt
@@ -0,0 +1,18 @@
+--type msi
+--name ${app.name}
+--win-menu
+--win-menu-group ${windows.vendor}
+--vendor ${windows.vendor}
+--icon "${project.basedir}/src/packaging/appicon.ico"
+--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"
+--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