Making cleanBuild.sh frun the ui/ build when invoked from the ./ui dir
Test: cd ui && ../cleanBuild.sh help
Change-Id: Ic1f3e58dd99027d9834a2ecd0dd008870aec7964
diff --git a/cleanBuild.sh b/cleanBuild.sh
index 00960bd..1130b2f 100755
--- a/cleanBuild.sh
+++ b/cleanBuild.sh
@@ -1,6 +1,5 @@
#!/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."
@@ -31,6 +30,14 @@
usage
fi
+if [ ! -e "./gradlew" ]; then
+ echo "Error; ./gradlew does not exist. Must cd to a dir containing a ./gradlew first"
+ # so that this script knows which gradlew to use (in frameworks/support or frameworks/support/ui)
+ exit 1
+fi
+
+
+
function confirm() {
# Confirm whether the user wants to run this script instead of diagnose-build-failure.sh
# Recall that we already mentioned the existence of diagnose-build-failure.sh above