summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMete Polat <metepolat2000@gmail.com>2016-02-26 16:42:51 +0100
committerChirayu Desai <chirayudesai1@gmail.com>2016-08-28 00:04:47 +0530
commitd4317adac31557aa05ec24e96e5fdcf59bafc04b (patch)
tree8d79b3ab4cf98cf1a6c901a3a2191063bf0bce78
parentaf2d62c7f2bad14fae062f410b989cd27075dca9 (diff)
downloadandroid_development-d4317adac31557aa05ec24e96e5fdcf59bafc04b.tar.gz
android_development-d4317adac31557aa05ec24e96e5fdcf59bafc04b.tar.bz2
android_development-d4317adac31557aa05ec24e96e5fdcf59bafc04b.zip
idegen: Check if environment variable exists
Check if the $ANDROID_HOST_OUT variable exists in the environment Change-Id: I1086f34188f306ad4b864c7461b3f5cd263a89a7
-rwxr-xr-xtools/idegen/idegen.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/idegen/idegen.sh b/tools/idegen/idegen.sh
index 1c3ba18cc..2dbff37b1 100755
--- a/tools/idegen/idegen.sh
+++ b/tools/idegen/idegen.sh
@@ -5,9 +5,14 @@ if [ ! -d development ]; then
exit 1
fi
+if [ -z "$ANDROID_HOST_OUT" ]; then
+ echo "Couldn't find host out directory. Make sure ANDROID_HOST_OUT is in your environment."
+ exit 127
+fi
+
idegenjar=`find $ANDROID_HOST_OUT -name idegen.jar -follow | grep -v intermediates`
-if [ "" = "$idegenjar" ]; then
- echo "Couldn't find idegen.jar. Please run make first."
-else
+if [ -z "$idegenjar" ]; then
+ echo "Couldn't find idegen.jar. Please run 'make idegen' first."
+else
java -cp $idegenjar Main
fi