Skip to content

Commit b67fd3e

Browse files
authored
Merge pull request #49 from sillydan1/ci-for-gnu-osx-and-win
Builds through CI for GNU/Linux, MacOSX and Windows
2 parents fa4ecee + ce33aa5 commit b67fd3e

File tree

8 files changed

+112
-20
lines changed

8 files changed

+112
-20
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ on:
88

99
jobs:
1010
build:
11-
1211
runs-on: ubuntu-latest
13-
1412
steps:
1513
- uses: actions/checkout@v2
1614
- name: Set up JDK 17
@@ -27,4 +25,55 @@ jobs:
2725
- name: Grant execute permission for gradlew
2826
run: chmod +x gradlew
2927
- name: Build with Gradle
30-
run: ./gradlew build
28+
run: ./gradlew jpackageImage
29+
- name: Archive production artifacts
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: h-uppaal-linux
33+
path: |
34+
build/jpackage
35+
36+
build-macos:
37+
runs-on: macOS-latest
38+
steps:
39+
- uses: actions/checkout@v2
40+
- name: Set up JDK 17
41+
uses: actions/setup-java@v1
42+
with:
43+
java-version: 17
44+
java-package: jdk
45+
- name: Cache Gradle packages
46+
uses: actions/cache@v1
47+
with:
48+
path: ~/.gradle/caches
49+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
50+
restore-keys: ${{ runner.os }}-gradle
51+
- name: Grant execute permission for gradlew
52+
run: chmod +x gradlew
53+
- name: Build with Gradle
54+
run: ./gradlew jpackageImage
55+
- name: Archive production artifacts
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: h-uppaal-osx
59+
path: |
60+
build/jpackage
61+
62+
build-windows:
63+
runs-on: windows-latest
64+
steps:
65+
- uses: actions/checkout@v2
66+
- name: Set up JDK 17
67+
uses: actions/setup-java@v1
68+
with:
69+
java-version: 17
70+
java-package: jdk
71+
- name: Build with Gradle
72+
run: ./gradlew jpackageImage
73+
working-directory: ${{ github.workspace }}
74+
- name: Archive production artifacts
75+
uses: actions/upload-artifact@v2
76+
with:
77+
name: h-uppaal-windows
78+
path: |
79+
build/jpackage

META-INF/MANIFEST.MF

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Main-Class: HUPPAAL
3+

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@ Before installing H-UPPAAL, make sure that you have Java 8 and JavaFX installed.
1212

1313
-----
1414

15-
If you are using Linux, you may install JavaFX with the following command:
15+
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/))
1616
```
17-
$ sudo apt-get install openjfx
17+
-Dprism.order=sw
1818
```
1919

20-
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/))
20+
### Linux
21+
If you are using Linux, you may have to install JavaFX with the following command:
2122
```
22-
-Dprism.order=sw
23+
$ sudo apt install openjfx
2324
```
25+
### Windows/OSX
26+
If the app fails to load javafx, you can download the runtime libraries of openjfx from the [gluonhq site](https://gluonhq.com/products/javafx/)
27+
28+
On OSX, you might have to add an exception in the security settings panel in order to launch H-Uppaal.
2429

2530
## Using the UPPAAL backend
2631
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.

build.gradle

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
22
id 'java'
33
id 'application'
4-
id 'org.openjfx.javafxplugin' version '0.0.10'
5-
id 'org.beryx.jlink' version '2.24.4'
4+
id 'org.openjfx.javafxplugin' version '0.0.13'
5+
id 'org.beryx.runtime' version '1.12.7'
66
}
77

88
mainClassName = 'HUPPAAL'
@@ -13,8 +13,11 @@ java {
1313
}
1414

1515
javafx {
16-
version = "17"
17-
modules = ['javafx.controls', 'javafx.fxml']
16+
version = '19'
17+
modules = ['javafx.controls',
18+
'javafx.fxml',
19+
'javafx.graphics',
20+
'javafx.base']
1821
}
1922

2023
// This list of "allowed" illegal reflection access definitions originates from jfoenix in this github issue:
@@ -52,6 +55,30 @@ application {
5255
applicationDefaultJvmArgs = ['-XX:+UseZGC'] + reflectionHack
5356
}
5457

58+
runtime {
59+
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
60+
launcher {
61+
noConsole = true
62+
}
63+
jpackage {
64+
// Uncomment and adjust the following line if your runtime task is configured to generate images for multiple platforms
65+
// targetPlatformName = "mac"
66+
def currentOs = org.gradle.internal.os.OperatingSystem.current()
67+
def imgType = currentOs.windows ? 'ico' : currentOs.macOsX ? 'icns' : 'png'
68+
imageOptions += ['--icon', "src/main/resources/huppaal.$imgType"]
69+
installerOptions += ['--resource-dir', "src/main/resources"]
70+
installerOptions += ['--vendor', 'Aalborg University']
71+
72+
if (currentOs.windows) {
73+
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut']
74+
} else if (currentOs.linux) {
75+
installerOptions += ['--linux-package-name', 'huppaal', '--linux-shortcut']
76+
} else if (currentOs.macOsX) {
77+
installerOptions += ['--mac-package-name', 'huppaal']
78+
}
79+
}
80+
}
81+
5582
repositories {
5683
mavenCentral()
5784
}
@@ -74,18 +101,23 @@ dependencies {
74101
implementation group: 'de.codecentric.centerdevice', name: 'javafxsvg', version: '1.3.0'
75102
implementation group: 'com.github.jiconfont', name: 'jiconfont-javafx', version: '1.0.0'
76103
implementation group: 'com.github.jiconfont', name: 'jiconfont-google_material_design_icons', version: '2.2.0.2'
77-
implementation group: 'org.kordamp.ikonli', name: 'ikonli-core', version: '12.2.0'
78-
implementation group: 'org.kordamp.ikonli', name: 'ikonli-material-pack', version: '12.2.0'
79-
implementation group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: '12.2.0'
80-
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
81-
implementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'
104+
implementation group: 'org.kordamp.ikonli', name: 'ikonli-core', version: '12.3.1'
105+
implementation group: 'org.kordamp.ikonli', name: 'ikonli-material-pack', version: '12.3.1'
106+
implementation group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: '12.3.1'
107+
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.0'
108+
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre'
82109
implementation group: 'org.hildan.fxgson', name: 'fx-gson', version: '4.0.1'
83-
implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.7'
110+
implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.9'
111+
112+
implementation group: 'org.openjfx', name: 'javafx', version: '19'
113+
implementation group: 'org.openjfx', name: 'javafx-graphics', version: '19'
114+
implementation group: 'org.openjfx', name: 'javafx-controls', version: '19'
115+
implementation group: 'org.openjfx', name: 'javafx-base', version: '19'
84116

85117
//Junit
86-
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.1'
87-
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.1'
88-
testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.8.1'
118+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.0'
119+
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.0'
120+
testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.9.0'
89121
}
90122

91123
test {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Main-Class: HUPPAAL
3+

src/main/resources/huppaal.icns

46.6 KB
Binary file not shown.

src/main/resources/huppaal.ico

108 KB
Binary file not shown.

src/main/resources/huppaal.png

7.13 KB
Loading

0 commit comments

Comments
 (0)