Bug 874132 - Part 1: Handle SDK layout differences in the Android r22 SDK. r=nalexander

Author:    Nathan Froyd <froydnj@gmail.com>

--HG--
extra : rebase_source : 614b386efc0a2b13c6570c99d09d6ec99146c3e1
This commit is contained in:
Nathan Froyd 2013-06-18 09:25:15 -07:00
parent 82717d4434
commit 0534491630
3 changed files with 32 additions and 2 deletions

View File

@ -305,6 +305,19 @@ case "$target" in
if test ! -d "$android_platform_tools" ; then if test ! -d "$android_platform_tools" ; then
android_platform_tools="$android_sdk"/tools # SDK Tools < r8 android_platform_tools="$android_sdk"/tools # SDK Tools < r8
fi fi
# The build tools got moved around to different directories in
# SDK Tools r22. Try to locate them.
android_build_tools=""
for suffix in 17.0.0 android-4.2.2; do
tools_directory="$android_sdk/../../build-tools/$suffix"
if test -d "$tools_directory" ; then
android_build_tools="$tools_directory"
break
fi
done
if test -z "$android_build_tools" ; then
android_build_tools="$android_platform_tools" # SDK Tools < r22
fi
ANDROID_SDK="${android_sdk}" ANDROID_SDK="${android_sdk}"
if test -e "${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar" ; then if test -e "${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar" ; then
ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar" ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar"
@ -312,12 +325,14 @@ case "$target" in
ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/support/v4/android-support-v4.jar"; ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/support/v4/android-support-v4.jar";
fi fi
ANDROID_PLATFORM_TOOLS="${android_platform_tools}" ANDROID_PLATFORM_TOOLS="${android_platform_tools}"
ANDROID_BUILD_TOOLS="${android_build_tools}"
AC_SUBST(ANDROID_SDK) AC_SUBST(ANDROID_SDK)
AC_SUBST(ANDROID_COMPAT_LIB) AC_SUBST(ANDROID_COMPAT_LIB)
if ! test -e $ANDROID_COMPAT_LIB ; then if ! test -e $ANDROID_COMPAT_LIB ; then
AC_MSG_ERROR([You must download the Android support library when targeting Android. Run the Android SDK tool and install Android Support Library under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_COMPAT_LIB)]) AC_MSG_ERROR([You must download the Android support library when targeting Android. Run the Android SDK tool and install Android Support Library under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_COMPAT_LIB)])
fi fi
AC_SUBST(ANDROID_PLATFORM_TOOLS) AC_SUBST(ANDROID_PLATFORM_TOOLS)
AC_SUBST(ANDROID_BUILD_TOOLS)
;; ;;
esac esac

View File

@ -12,8 +12,8 @@ ifndef JAVA_CLASSPATH
$(error JAVA_CLASSPATH must be defined before including android-common.mk) $(error JAVA_CLASSPATH must be defined before including android-common.mk)
endif endif
DX=$(ANDROID_PLATFORM_TOOLS)/dx DX=$(ANDROID_BUILD_TOOLS)/dx
AAPT=$(ANDROID_PLATFORM_TOOLS)/aapt AAPT=$(ANDROID_BUILD_TOOLS)/aapt
APKBUILDER=$(ANDROID_SDK)/../../tools/apkbuilder APKBUILDER=$(ANDROID_SDK)/../../tools/apkbuilder
ZIPALIGN=$(ANDROID_SDK)/../../tools/zipalign ZIPALIGN=$(ANDROID_SDK)/../../tools/zipalign

View File

@ -305,6 +305,19 @@ case "$target" in
if test ! -d "$android_platform_tools" ; then if test ! -d "$android_platform_tools" ; then
android_platform_tools="$android_sdk"/tools # SDK Tools < r8 android_platform_tools="$android_sdk"/tools # SDK Tools < r8
fi fi
# The build tools got moved around to different directories in
# SDK Tools r22. Try to locate them.
android_build_tools=""
for suffix in 17.0.0 android-4.2.2; do
tools_directory="$android_sdk/../../build-tools/$suffix"
if test -d "$tools_directory" ; then
android_build_tools="$tools_directory"
break
fi
done
if test -z "$android_build_tools" ; then
android_build_tools="$android_platform_tools" # SDK Tools < r22
fi
ANDROID_SDK="${android_sdk}" ANDROID_SDK="${android_sdk}"
if test -e "${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar" ; then if test -e "${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar" ; then
ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar" ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar"
@ -312,12 +325,14 @@ case "$target" in
ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/support/v4/android-support-v4.jar"; ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/support/v4/android-support-v4.jar";
fi fi
ANDROID_PLATFORM_TOOLS="${android_platform_tools}" ANDROID_PLATFORM_TOOLS="${android_platform_tools}"
ANDROID_BUILD_TOOLS="${android_build_tools}"
AC_SUBST(ANDROID_SDK) AC_SUBST(ANDROID_SDK)
AC_SUBST(ANDROID_COMPAT_LIB) AC_SUBST(ANDROID_COMPAT_LIB)
if ! test -e $ANDROID_COMPAT_LIB ; then if ! test -e $ANDROID_COMPAT_LIB ; then
AC_MSG_ERROR([You must download the Android support library when targeting Android. Run the Android SDK tool and install Android Support Library under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_COMPAT_LIB)]) AC_MSG_ERROR([You must download the Android support library when targeting Android. Run the Android SDK tool and install Android Support Library under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_COMPAT_LIB)])
fi fi
AC_SUBST(ANDROID_PLATFORM_TOOLS) AC_SUBST(ANDROID_PLATFORM_TOOLS)
AC_SUBST(ANDROID_BUILD_TOOLS)
;; ;;
esac esac