-
Notifications
You must be signed in to change notification settings - Fork 0
/
package_local.sh
executable file
·41 lines (36 loc) · 1.04 KB
/
package_local.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
cd "$(dirname "$(readlink -f "$0")")" || exit 1
VERSION=`cat VERSION`
export VERSION
echo "Version=$VERSION"
cp ~/.m2/repository/com/javax0/jamal/jamal-cmd/${VERSION}/jamal-cmd-${VERSION}-distribution.zip .
mkdir -p target/JARS
rm -rf target/JARS/*
unzip jamal-cmd-${VERSION}-distribution.zip -d target/JARS
# Function to create package based on the operating system
create_package() {
local INSTALLER_TYPE=$1
jpackage --input target/JARS \
--vendor "Peter Verhas" \
--name jamal \
--app-version ${VERSION%%-*} \
--main-jar jamal-cmd-${VERSION}.jar \
--main-class javax0.jamal.cmd.JamalMain \
--type $INSTALLER_TYPE \
--dest output \
--java-options -Xmx2048m \
--resource-dir packaging-resources
}
# Detect the operating system and create appropriate package
case "$(uname -s)" in
Linux*)
create_package deb
;;
Darwin*)
create_package pkg
;;
*)
echo "Unsupported operating system"
exit 1
;;
esac