Skip to content

Commit

Permalink
Merge pull request #49 from sillydan1/ci-for-gnu-osx-and-win
Browse files Browse the repository at this point in the history
Builds through CI for GNU/Linux, MacOSX and Windows
  • Loading branch information
sillydan1 authored Oct 10, 2022
2 parents fa4ecee + ce33aa5 commit b67fd3e
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 20 deletions.
55 changes: 52 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
Expand All @@ -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
3 changes: 3 additions & 0 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: HUPPAAL

13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
58 changes: 45 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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:
Expand Down Expand Up @@ -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()
}
Expand All @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: HUPPAAL

Binary file added src/main/resources/huppaal.icns
Binary file not shown.
Binary file added src/main/resources/huppaal.ico
Binary file not shown.
Binary file added src/main/resources/huppaal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b67fd3e

Please sign in to comment.