From 0c13006a7f6556e8130f541f8ca4c034ccbeb4c4 Mon Sep 17 00:00:00 2001 From: "james.wei@intel.com" Date: Fri, 11 May 2012 02:47:35 +0000 Subject: fix issue of -o option deprecated in latest sdk update with --all instead when installing android build deps. this issue is cloned from https://chromiumcodereview.appspot.com/10164002/ for ownership issue. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10261036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136491 0039d316-1c4b-4281-b951-d872f2087c98 --- build/install-build-deps-android-sdk.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'build') diff --git a/build/install-build-deps-android-sdk.sh b/build/install-build-deps-android-sdk.sh index 1709845..8e068a9 100755 --- a/build/install-build-deps-android-sdk.sh +++ b/build/install-build-deps-android-sdk.sh @@ -107,8 +107,18 @@ if [[ "$found" = "0" ]]; then # This will take a little bit long time. echo "Install platform, platform-tool and tool ..." - "${ANDROID_SDK_ROOT}"/tools/android update sdk -o --no-ui \ - --filter platform,platform-tool,tool,system-image + # Check the SDK revision + SDK_VER=$(sed '/^\#/d' ${ANDROID_SDK_ROOT}/tools/source.properties | \ + grep 'Pkg.Revision' |tail -n 1 | cut -d "=" -f2- | \ + sed 's/^[[:space:]]*//;s/[[:space:]]*$//') + if [[ ${SDK_VER} -lt 17 ]]; then + update_flag=" -o " + else + update_flag=" --all " + fi + # Updates the SDK to latest version firstly. + "${ANDROID_SDK_ROOT}"/tools/android update sdk ${update_flag} --no-ui \ + --filter platform,platform-tool,tool,system-image fi # Create a Android Virtual Device named 'buildbot' with default hardware -- cgit v1.1