-
Notifications
You must be signed in to change notification settings - Fork 0
/
cleanBuild.sh
executable file
·35 lines (29 loc) · 1023 Bytes
/
cleanBuild.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
#!/bin/bash
set -e
cd $(dirname $0)
echo "IF THIS SCRIPT FIXES YOUR BUILD; OPEN A BUG."
echo "(in nearly all cases, it should not be necessary to run a clean build)."
# one case where it is convenient to have a clean build is for double-checking that a build failure isn't due to an incremental build failure
# another case where it is convenient to have a clean build is for performance testing
# another case where it is convenient to have a clean build is when you're modifying the build and may have introduced some errors but haven't shared your changes yet (at which point you should have fixed the errors)
echo
goals="$@"
function usage() {
echo "Usage: $0 <tasks>"
echo "Runs a clean build of <tasks>"
exit 1
}
if [ "$goals" == "" ]; then
usage
fi
export OUT_DIR=../../out
function removeCaches() {
rm -rf .gradle
rm -rf buildSrc/.gradle
rm -rf buildSrc/build
rm -f local.properties
rm -rf ../../out
}
removeCaches
echo running build
GRADLE_USER_HOME=../../out ./gradlew --no-daemon $goals