-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxgradle
executable file
·60 lines (51 loc) · 870 Bytes
/
xgradle
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
#!/bin/bash
# Script filename
SCRIPT_NAME="${0##*/}"
## {{{ error()
function error()
{
echo >&2 "$SCRIPT_NAME: error:" "$@"
}
## }}}
## {{{ die()
function die()
{
error "$@"
exit 1
}
## }}}
if [[ $# -lt 1 ]]
then
echo "Usage: $SCRIPT_NAME <task...>"
echo
echo "Shortcuts:"
echo
echo " client Tasks: [build, runData, runClient]"
echo " data Tasks: [build, runData]"
exit 1
fi
[[ -f gradlew ]] || die "Gradle wrapper 'gradlew' not found"
[[ -x gradlew ]] || die "Gradle wrapper 'gradlew' not executable"
function run()
{
local task="$1"
./gradlew "$task" \
|| die "Gradle exited with non-ero status $?"
}
case "$1" in
client)
tasks=(build runData runClient)
;;
data)
tasks=(build runData)
;;
*)
tasks=("$@")
;;
esac
for task in "${tasks[@]}"
do
run "$task"
done
#
# vim: ts=2 sw=2 et fdm=marker :