-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild-all.sh
More file actions
executable file
·38 lines (30 loc) · 795 Bytes
/
build-all.sh
File metadata and controls
executable file
·38 lines (30 loc) · 795 Bytes
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
#!/usr/bin/env bash
set -e
shopt -s extglob
timed() {
end=$(date +%s)
dt=$(("$end" - $1))
dd=$(("$dt" / 86400))
dt2=$(("$dt" - 86400 * "$dd"))
dh=$(("$dt2" / 3600))
dt3=$(("$dt2" - 3600 * "$dh"))
dm=$(("$dt3" / 60))
ds=$(("$dt3" - 60 * "$dm"))
LC_NUMERIC=C printf "\nTotal runtime: %02d min %02d seconds\n" "$dm" "$ds"
}
start=$(date +%s)
trap 'timed $start' EXIT
services="$*"
for dir in ./modules/*; do
name="$(basename "$dir")"
gradlew_exist="$dir"/gradlew
if [[ ! -f $gradlew_exist ]]; then
continue
fi
if [[ "${services}" && ! "${services[*]}" =~ ${name} ]]; then
printf "=== Skipping building module %s ===\n" "$name"
continue
fi
printf "\n=== Building module '%s' ===\n" "$(basename "$dir")"
"$dir"/gradlew clean build -p "$dir"
done