Skip to content

Commit cc3e3a4

Browse files
committed
Add macOS and Linux jpackage native installer build script
1 parent cd5c75b commit cc3e3a4

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

installer/build-native.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
set -eu
3+
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
4+
cd "$ROOT"
5+
6+
mvn -B clean package
7+
mkdir -p dist
8+
APP_VERSION=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version)
9+
JAR="target/us-house-installer-${APP_VERSION}.jar"
10+
11+
if [ ! -f "$JAR" ]; then
12+
echo "Build did not produce $JAR" >&2
13+
exit 1
14+
fi
15+
16+
case "$(uname -s)" in
17+
Darwin)
18+
jpackage --type dmg --name US-House-Installer --input target --main-jar "$(basename "$JAR")" --main-class us.house.installer.USHouseInstaller --dest dist
19+
;;
20+
Linux)
21+
jpackage --type deb --name us-house-installer --input target --main-jar "$(basename "$JAR")" --main-class us.house.installer.USHouseInstaller --dest dist
22+
;;
23+
*)
24+
echo "Use build-native.ps1 on Windows." >&2
25+
exit 2
26+
;;
27+
esac
28+
29+
echo "Native installer written to $ROOT/dist"

0 commit comments

Comments
 (0)