-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·66 lines (51 loc) · 1.51 KB
/
build.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
#!/bin/bash
set -u
build-for-platform() {
PLATFORM=$1
OUTPUT_DIR="output/theroundtable-$PLATFORM-x64"
FILES="app-files-$PLATFORM"
JDK="$HOME/.jdks/openjdk-22.0.2_$PLATFORM-x64_bin/"
rm -rf "OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR"
cp -r "bin" "$OUTPUT_DIR"
cp -r "styles" "$OUTPUT_DIR"
cp -r "images" "$OUTPUT_DIR"
cp -r "$FILES/." "$OUTPUT_DIR"
cp -r "$JDK" "$OUTPUT_DIR/jdk"
if [ "$PLATFORM" == "linux" ]; then
(
cd "app-launcher" || exit
cross build --target x86_64-unknown-linux-gnu --release -p app_launcher
mv "target/x86_64-unknown-linux-gnu/release/app_launcher" "../$OUTPUT_DIR/start"
)
elif [ "$PLATFORM" == "windows" ]; then
(
cd "app-launcher" || exit
cross build --target x86_64-pc-windows-gnu --release -p app_launcher
mv "target/x86_64-pc-windows-gnu/release/app_launcher.exe" "../$OUTPUT_DIR/start.exe"
)
fi
}
if [ "$#" -ne 1 ]; then
echo "Uso: $0 <linux | windows | all> "
exit 1
fi
if [ "$1" != "linux" ] && [ "$1" != "windows" ] && [ "$1" != "all" ]; then
echo "Not supported platform: $1"
exit 1
fi
mvn package -P desktop
# Asignar variables
PLATFORM=$1
if [ "$PLATFORM" == "linux" ] || [ "$PLATFORM" == "all" ]; then
build-for-platform "linux" &
fi
if [ "$PLATFORM" == "windows" ] || [ "$PLATFORM" == "all" ]; then
build-for-platform "windows" &
fi
wait
# izpack
if [ "$PLATFORM" == "all" ]; then
izpack -h "$IZPACK_HOME" -l 9 izpack.xml -o output/installer.jar
fi
rm -rf "bin"