This repository has been archived by the owner on Oct 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
/
make-and-bundle.sh
executable file
·94 lines (83 loc) · 1.96 KB
/
make-and-bundle.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
#set -e
OUB_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
OBF_DIR="$( dirname "$OUB_DIR" )"
LOG_FILE="$OBF_DIR"/build.log
FINISH_FLAG="$OBF_DIR"/build_finished.flag
# options
DEBUG_SWITCH=
ICEDTEA_SWITCH=
IS_FINISH=
usage()
{
cat << EOF
usage: $0 [-d -i]
options:
-d debug build
-i icedtea build
-f write finish flag on success
-h show this message
EOF
}
while getopts "hdif" OPTION
do
case $OPTION in
h)
usage
exit
;;
d)
DEBUG_SWITCH="-d"
;;
i)
ICEDTEA_SWITCH="-i"
;;
f)
IS_FINISH="true"
;;
?)
usage
exit
;;
esac
done
echo "Starting make" >> "$LOG_FILE"
cd "$OBF_DIR"/openjdk
make >> "$LOG_FILE" 2>&1
if [ $? -ne 0 ] ; then
echo "Build aborted with error on 'make'" >> "$LOG_FILE"
echo error > "$FINISH_FLAG"
exit 1
fi
#make test >> "$LOG_FILE" 2>&1
#if [ $? -ne 0 ] ; then
# echo "Build aborted with error on 'make test'" >> "$LOG_FILE"
# echo error > "$FINISH_FLAG"
# exit 1
#fi
# Prepare bundles
if [ ! -d "$OBF_DIR"/dist ] ; then
mkdir "$OBF_DIR"/dist
fi
cd "$OBF_DIR"/dist
echo "Bundling image" >> "$LOG_FILE"
"$OBF_DIR"/oub/installer/build-image.sh $DEBUG_SWITCH $ICEDTEA_SWITCH -s "$OBF_DIR"/openjdk >> "$LOG_FILE" 2>&1
if [ $? -ne 0 ] ; then
echo "Build aborted with error on 'image'" >> "$LOG_FILE"
echo error > "$FINISH_FLAG"
exit 1
fi
if [ "x" == "x$DEBUG_SWITCH" ] ; then
echo "Building installer" >> "$LOG_FILE"
"$OBF_DIR"/oub/installer/build-installer.sh $ICEDTEA_SWITCH -s "$OBF_DIR"/openjdk >> "$LOG_FILE" 2>&1
if [ $? -ne 0 ] ; then
echo "Build aborted with error on 'installer'" >> "$LOG_FILE"
echo error > "$FINISH_FLAG"
exit 1
fi
fi
echo "Build finished successfully" >> "$LOG_FILE"
if [ "true" == "$IS_FINISH" ] ; then
echo success > "$FINISH_FLAG"
fi
exit 0