old-ndk-build.sh: support standard ANDROID_HOME env var

Google has defined the ANDROID_HOME env var as the standard env var to
point to the Android SDK install.  It is not so well documented, but it is
documented here and there:

https://developer.android.com/tools/testing/testing_ui.html#builddeploy
http://books.sonatype.com/mvnref-book/reference/android-dev-sect-config-build.html
This commit is contained in:
Hans-Christoph Steiner 2015-01-07 23:22:42 +01:00
parent 56eee3216f
commit ba15646534

View file

@ -4,15 +4,23 @@ SCRIPT_LOC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NAME=$(basename $(dirname "${BASH_SOURCE[0]}") )
if [ ! -d "$ANDROID_SDK" ]; then
echo "ANDROID_SDK is not set"
if [ -d "$ANDROID_HOME" ]; then
# for backwards compatbility
export ANDROID_SDK=$ANDROID_HOME
else
echo "ANDROID_HOME is not set, trying ANDROID_SDK:"
if [ -d "$ANDROID_SDK" ]; then
export ANDROID_HOME=$ANDROID_SDK
else
echo "ANDROID_SDK is also not set"
exit
fi
fi
if [ ! -d "$ANDROID_NDK" ]; then
echo "ANDROID_NDK is not set"
exit
fi
export ANDROID_SDK_ROOT=$ANDROID_SDK
export ANDROID_SDK_ROOT=$ANDROID_HOME
export ANDROID_NDK_ROOT=$ANDROID_NDK
export ANDROID_NDK_TOOLCHAIN_VERSION=4.7