-
Notifications
You must be signed in to change notification settings - Fork 53
/
PackageMacos.sh
59 lines (46 loc) · 1.32 KB
/
PackageMacos.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
#!/bin/sh
set -x
CURRENT_DIR=$(pwd)
TARGET_DIR=$CURRENT_DIR/target
RELEASE_JAR_FILE=$(ls -al target/ApkToolBoxGUI-*.jar | awk '{print $9}')
VERSION=${RELEASE_JAR_FILE#*ApkToolBoxGUI-}
VERSION=${VERSION%*.jar}
TMP_DIR="$TARGET_DIR/release"
# Build $TARGET_DIR/ApkToolBoxGUI-$VERSION-without-JRE.zip
if [ -d $TMP_DIR ];
then
rm -rf $TMP_DIR
fi
if [ ! -d $TMP_DIR ];
then
mkdir -p $TMP_DIR
fi
cp $RELEASE_JAR_FILE $TMP_DIR/ApkToolBoxGUI.jar
cp $CURRENT_DIR/ApkToolBoxGUI.sh $TMP_DIR
zip -rj $TARGET_DIR/ApkToolBoxGUI-$VERSION-without-JRE-Macos.zip $TMP_DIR/*
# Build $TARGET_DIR/ApkToolBoxGUI-$VERSION-with-JRE.zip
if [ -d $TMP_DIR ];
then
rm -rf $TMP_DIR
fi
if [ ! -d $TMP_DIR ];
then
mkdir -p $TMP_DIR
fi
if [ -d $TARGET_DIR/ApkToolBoxGUI-$VERSION-with-JRE ];
then
rm -rf $TARGET_DIR/ApkToolBoxGUI-$VERSION-with-JRE.app
fi
cp $RELEASE_JAR_FILE $TMP_DIR/ApkToolBoxGUI.jar
jpackage --input $TMP_DIR --type app-image --name ApkToolBoxGUI-$VERSION-with-JRE --main-jar ApkToolBoxGUI.jar --dest $TARGET_DIR --verbose
cd $TARGET_DIR/ApkToolBoxGUI-$VERSION-with-JRE.app
zip -r $TARGET_DIR/ApkToolBoxGUI-$VERSION-with-JRE-Macos.zip ./*
cd $CURRENT_DIR
if [ -d $TMP_DIR ];
then
rm -rf $TMP_DIR
fi
if [ -d $TARGET_DIR/ApkToolBoxGUI-$VERSION-with-JRE.app ];
then
rm -rf $TARGET_DIR/ApkToolBoxGUI-$VERSION-with-JRE.app
fi