blob: e2681ffbcd49a61eec884bb52e5e4ce61a870260 [file] [log] [blame]
Jeff Gaston8aa46b32018-09-27 16:14:14 -04001#!/bin/bash
2set -e
3cd $(dirname $0)
4
5echo "IF THIS SCRIPT FIXES YOUR BUILD; OPEN A BUG."
6echo "(in nearly all cases, it should not be necessary to run a clean build)."
7# 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
8# another case where it is convenient to have a clean build is for performance testing
9# 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)
10echo
11
12goals="$@"
13
14function usage() {
15 echo "Usage: $0 <tasks>"
16 echo "Runs a clean build of <tasks>"
17 exit 1
18}
19
20if [ "$goals" == "" ]; then
21 usage
22fi
23
24export OUT_DIR=../../out
25function removeCaches() {
George Mount34ddc312018-10-24 13:53:18 -070026 rm -rf .gradle
27 rm -rf buildSrc/.gradle
28 rm -rf buildSrc/build
Jeff Gaston8aa46b32018-09-27 16:14:14 -040029 rm -f local.properties
George Mount34ddc312018-10-24 13:53:18 -070030 rm -rf ../../out
Jeff Gaston8aa46b32018-09-27 16:14:14 -040031}
32removeCaches
33
34echo running build
35GRADLE_USER_HOME=../../out ./gradlew --no-daemon $goals