-
Notifications
You must be signed in to change notification settings - Fork 0
/
linux-packager.sh
78 lines (61 loc) · 1.87 KB
/
linux-packager.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
jarNames=( \
"commons-io-2.6" \
"json-20200518" \
)
descriptors=( \
"org.apache.commons.io" \
"org.json" \
)
unusedJars=( \
"javafx-base-14.0.2" \
"javafx-controls-14.0.2" \
"javafx-fxml-14.0.2" \
"javafx-graphics-14.0.2" \
)
echo ">> COMPILING"
mvn --file pom.xml \
clean \
dependency:copy-dependencies \
compile
echo ">> REMOVING EMPTY DEPENDENCIES"
for (( i=0; i<${#unusedJars[@]}; i++ ))
do
echo removing "${unusedJars[$i]}"
rm target/dependency/"${unusedJars[$i]}".jar
done
echo ">> COMPILING MODULE INFOS"
for (( i=0; i<${#jarNames[@]}; i++ ))
do
echo Processing "${descriptors[$i]}" in "${jarNames[$i]}".jar
"$JAVA_HOME"/bin/jdeps \
--module-path target/dependency \
--generate-module-info target/module-info \
target/dependency/"${jarNames[$i]}".jar
"$JAVA_HOME"/bin/javac \
--module-path target/dependency \
-d target/module-extensions/"${descriptors[$i]}" \
--patch-module "${descriptors[$i]}"=target/dependency/"${jarNames[$i]}".jar \
target/module-info/"${descriptors[$i]}"/module-info.java
"$JAVA_HOME"/bin/jar \
uf target/dependency/"${jarNames[$i]}".jar \
-C target/module-extensions/"${descriptors[$i]}" module-info.class
done
echo ">> LINKING"
"$JAVA_HOME"/bin/jlink \
--module-path target/classes:target/dependency \
--add-modules ru.covariance.mythkeeperpackager \
--launcher launch=ru.covariance.mythkeeperpackager/ru.covariance.mythkeeperpackager.app.Launcher \
--output target/linked \
--strip-debug \
--compress 2 \
--no-header-files \
--no-man-pages
echo ">> PACKAGING"
"$JAVA_HOME"/bin/jpackage \
--name mythkeeper-packager \
--app-version 1.0.0 \
--dest target/package \
--runtime-image target/linked \
--module ru.covariance.mythkeeperpackager/ru.covariance.mythkeeperpackager.app.Launcher \
--linux-shortcut \
--linux-deb-maintainer [email protected]