diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 100b7234..8c55acb9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,9 +8,7 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - name: Set up JDK 17 @@ -27,4 +25,55 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build + run: ./gradlew jpackageImage + - name: Archive production artifacts + uses: actions/upload-artifact@v2 + with: + name: h-uppaal-linux + path: | + build/jpackage + + build-macos: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + java-package: jdk + - name: Cache Gradle packages + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew jpackageImage + - name: Archive production artifacts + uses: actions/upload-artifact@v2 + with: + name: h-uppaal-osx + path: | + build/jpackage + + build-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + java-package: jdk + - name: Build with Gradle + run: ./gradlew jpackageImage + working-directory: ${{ github.workspace }} + - name: Archive production artifacts + uses: actions/upload-artifact@v2 + with: + name: h-uppaal-windows + path: | + build/jpackage diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF new file mode 100644 index 00000000..b4e37039 --- /dev/null +++ b/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: HUPPAAL + diff --git a/README.md b/README.md index 264a90a9..27776dba 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,20 @@ Before installing H-UPPAAL, make sure that you have Java 8 and JavaFX installed. ----- -If you are using Linux, you may install JavaFX with the following command: +If you experience a blank white screen in H-UPPAAL, disable hardware acceleration in the VM-options ([source](https://www.reddit.com/r/javahelp/comments/84w6i6/problem_displaying_anything_with_javafx_only/)) ``` -$ sudo apt-get install openjfx +-Dprism.order=sw ``` -If you experience a blank white screen in H-UPPAAL, disable hardware acceleration in the VM-options ([source](https://www.reddit.com/r/javahelp/comments/84w6i6/problem_displaying_anything_with_javafx_only/)) +### Linux +If you are using Linux, you may have to install JavaFX with the following command: ``` --Dprism.order=sw +$ sudo apt install openjfx ``` +### Windows/OSX +If the app fails to load javafx, you can download the runtime libraries of openjfx from the [gluonhq site](https://gluonhq.com/products/javafx/) + +On OSX, you might have to add an exception in the security settings panel in order to launch H-Uppaal. ## Using the UPPAAL backend When running the program, please make sure that you have the following folder structure (relative to the `huppaal.jar`-file). Feel free to only include binary-files for you operating system that you are using, e.g. `bin-Win32`. These binaries are found in the UPPAAL distibution and can simply be copied over to the `huppaal.jar` location. diff --git a/build.gradle b/build.gradle index c97de611..f706d194 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ plugins { id 'java' id 'application' - id 'org.openjfx.javafxplugin' version '0.0.10' - id 'org.beryx.jlink' version '2.24.4' + id 'org.openjfx.javafxplugin' version '0.0.13' + id 'org.beryx.runtime' version '1.12.7' } mainClassName = 'HUPPAAL' @@ -13,8 +13,11 @@ java { } javafx { - version = "17" - modules = ['javafx.controls', 'javafx.fxml'] + version = '19' + modules = ['javafx.controls', + 'javafx.fxml', + 'javafx.graphics', + 'javafx.base'] } // This list of "allowed" illegal reflection access definitions originates from jfoenix in this github issue: @@ -52,6 +55,30 @@ application { applicationDefaultJvmArgs = ['-XX:+UseZGC'] + reflectionHack } +runtime { + options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] + launcher { + noConsole = true + } + jpackage { + // Uncomment and adjust the following line if your runtime task is configured to generate images for multiple platforms + // targetPlatformName = "mac" + def currentOs = org.gradle.internal.os.OperatingSystem.current() + def imgType = currentOs.windows ? 'ico' : currentOs.macOsX ? 'icns' : 'png' + imageOptions += ['--icon', "src/main/resources/huppaal.$imgType"] + installerOptions += ['--resource-dir', "src/main/resources"] + installerOptions += ['--vendor', 'Aalborg University'] + + if (currentOs.windows) { + installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut'] + } else if (currentOs.linux) { + installerOptions += ['--linux-package-name', 'huppaal', '--linux-shortcut'] + } else if (currentOs.macOsX) { + installerOptions += ['--mac-package-name', 'huppaal'] + } + } +} + repositories { mavenCentral() } @@ -74,18 +101,23 @@ dependencies { implementation group: 'de.codecentric.centerdevice', name: 'javafxsvg', version: '1.3.0' implementation group: 'com.github.jiconfont', name: 'jiconfont-javafx', version: '1.0.0' implementation group: 'com.github.jiconfont', name: 'jiconfont-google_material_design_icons', version: '2.2.0.2' - implementation group: 'org.kordamp.ikonli', name: 'ikonli-core', version: '12.2.0' - implementation group: 'org.kordamp.ikonli', name: 'ikonli-material-pack', version: '12.2.0' - implementation group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: '12.2.0' - implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9' - implementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' + implementation group: 'org.kordamp.ikonli', name: 'ikonli-core', version: '12.3.1' + implementation group: 'org.kordamp.ikonli', name: 'ikonli-material-pack', version: '12.3.1' + implementation group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: '12.3.1' + implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.0' + implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre' implementation group: 'org.hildan.fxgson', name: 'fx-gson', version: '4.0.1' - implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.7' + implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.9' + + implementation group: 'org.openjfx', name: 'javafx', version: '19' + implementation group: 'org.openjfx', name: 'javafx-graphics', version: '19' + implementation group: 'org.openjfx', name: 'javafx-controls', version: '19' + implementation group: 'org.openjfx', name: 'javafx-base', version: '19' //Junit - testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.1' - testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.1' - testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.8.1' + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.0' + testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.0' + testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.9.0' } test { diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 00000000..b4e37039 --- /dev/null +++ b/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: HUPPAAL + diff --git a/src/main/resources/huppaal.icns b/src/main/resources/huppaal.icns new file mode 100644 index 00000000..7fd3cd50 Binary files /dev/null and b/src/main/resources/huppaal.icns differ diff --git a/src/main/resources/huppaal.ico b/src/main/resources/huppaal.ico new file mode 100644 index 00000000..bd9f6c88 Binary files /dev/null and b/src/main/resources/huppaal.ico differ diff --git a/src/main/resources/huppaal.png b/src/main/resources/huppaal.png new file mode 100644 index 00000000..2e983c4b Binary files /dev/null and b/src/main/resources/huppaal.png differ