-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
61 lines (50 loc) · 1002 Bytes
/
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
#!/usr/bin/env bash
# Build KMSample2
set -e
set -u
display_usage ( ) {
echo "build.sh [-no-daemon] [-debug]"
echo
echo "Build KM Sample 2"
echo " -no-daemon Don't start the Gradle daemon. Use for CI"
echo " -debug Compile only Debug variant"
exit 1
}
echo Build KMSample2
#
# Prevents 'clear' on exit of mingw64 bash shell
#
SHLVL=0
NO_DAEMON=false
ONLY_DEBUG=false
# Parse args
while [[ $# -gt 0 ]] ; do
key="$1"
case $key in
-no-daemon)
NO_DAEMON=true
;;
-debug)
ONLY_DEBUG=true
;;
-h|-\?)
display_usage
;;
esac
shift # past argument
done
echo
echo "NO_DAEMON: $NO_DAEMON"
echo "ONLY_DEBUG: $ONLY_DEBUG"
echo
if [ "$NO_DAEMON" = true ]; then
DAEMON_FLAG=--no-daemon
else
DAEMON_FLAG=
fi
if [ "$ONLY_DEBUG" = true ]; then
BUILD_FLAG=assembleDebug
else
BUILD_FLAG=build
fi
./gradlew $DAEMON_FLAG clean $BUILD_FLAG