Skip to content

Commit 51f2cab

Browse files
committed
Add Gradle jpackage configuration, add jpackage build steps to github-actions.
1 parent 68e44e3 commit 51f2cab

File tree

5 files changed

+63
-2
lines changed

5 files changed

+63
-2
lines changed

.github/workflows/workflow.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,37 @@ jobs:
3434
uses: actions/setup-java@v1
3535
with:
3636
java-version: '14.0.2'
37+
- name: Cache Gradle packages
38+
uses: actions/cache@v2
39+
with:
40+
path: ~/.gradle/caches
41+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
42+
restore-keys: ${{ runner.os }}-gradle
3743
- name: Verify Gradle wrapper
3844
uses: gradle/wrapper-validation-action@v1
3945
- name: Build
40-
run: ./gradlew --info --stacktrace jlinkZip
46+
run: ./gradlew --info --stacktrace jpackage
47+
- name: Upload installer (Windows, exe)
48+
if: runner.os == 'Windows'
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: BoundingBoxEditor-Windows-exe
52+
path: build/jpackage/*.exe
53+
- name: Upload installer (Linux, deb)
54+
if: runner.os == 'Linux'
55+
uses: actions/upload-artifact@v2
56+
with:
57+
name: BoundingBoxEditor-Linux-deb
58+
path: build/jpackage/*.deb
59+
- name: Upload installer (Linux, rpm)
60+
if: runner.os == 'Linux'
61+
uses: actions/upload-artifact@v2
62+
with:
63+
name: BoundingBoxEditor-Linux-rpm
64+
path: build/jpackage/*.rpm
65+
- name: Upload installer (macOS, dmg)
66+
if: runner.os == 'macOS'
67+
uses: actions/upload-artifact@v2
68+
with:
69+
name: BoundingBoxEditor-macOS-dmg
70+
path: build/jpackage/*.dmg

azure-pipelines.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ trigger:
1717
- LICENSE
1818
- README.md
1919
- demo-media/*
20+
- .github/workflows/
2021

2122
pr:
2223
- master

build.gradle

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,41 @@ java {
109109
jlink {
110110
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
111111
launcher {
112-
name = 'boundingboxeditor'
112+
name = 'BoundingBoxEditor'
113113
jvmArgs = ['-Dprism.forceGPU=true']
114114
}
115115

116116
imageZip = project.file("${buildDir}/distributions/boundingboxeditor-${javafx.platform.classifier}.zip")
117+
118+
jpackage {
119+
installerOptions += [
120+
'--app-version', version,
121+
'--copyright', 'Copyright 2020 Markus Fleischhacker',
122+
'--license-file', 'LICENSE',
123+
'--vendor', 'Markus Fleischhacker'
124+
]
125+
126+
if(org.gradle.internal.os.OperatingSystem.current().windows) {
127+
installerOptions += [
128+
'--win-per-user-install',
129+
'--win-dir-chooser',
130+
'--win-menu',
131+
'--win-menu-group', 'BoundingBoxEditor',
132+
'--win-shortcut'
133+
]
134+
icon = 'src/main/resources/icons/app_icon.ico'
135+
installerType = 'exe'
136+
} else if(org.gradle.internal.os.OperatingSystem.current().linux) {
137+
installerOptions += [
138+
'--resource-dir', 'build/jpackage/BoundingBoxEditor/lib',
139+
'--linux-shortcut',
140+
'--linux-menu-group', 'Science'
141+
]
142+
icon = 'src/main/resources/icons/app_icon.png'
143+
} else if(org.gradle.internal.os.OperatingSystem.current().macOsX) {
144+
icon = 'src/main/resources/icons/app_icon.icns'
145+
}
146+
}
117147
}
118148

119149
task dist {
6.75 KB
Binary file not shown.
3.56 KB
Binary file not shown.

0 commit comments

Comments
 (0)