summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorjames.wei@intel.com <james.wei@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-14 06:47:48 +0000
committerjames.wei@intel.com <james.wei@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-14 06:47:48 +0000
commit9f324fb0a73bbe316aaf9c97895c7cac1613abfe (patch)
tree0f7902e32d899d7af3fd9411873bf9b068788cb0 /build
parent41c10e04339aafdac4965299f3dc6e0cecbf6050 (diff)
downloadchromium_src-9f324fb0a73bbe316aaf9c97895c7cac1613abfe.zip
chromium_src-9f324fb0a73bbe316aaf9c97895c7cac1613abfe.tar.gz
chromium_src-9f324fb0a73bbe316aaf9c97895c7cac1613abfe.tar.bz2
upgrade SDK if current SDK version is lower than targeted one
Currently if an older SDK installed with target, the SDK will never upgrade. Modify build/install-build-deps-android-sdk.sh to detect the current installed SDK and upgrade it if it is older than desired one. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10700178 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/install-build-deps-android-sdk.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/build/install-build-deps-android-sdk.sh b/build/install-build-deps-android-sdk.sh
index ced46cd..572b66c 100755
--- a/build/install-build-deps-android-sdk.sh
+++ b/build/install-build-deps-android-sdk.sh
@@ -11,7 +11,9 @@ set -e
# Using Android 4.0, API Level: 14 (ice cream sandwich). The SDK package is
# about 25M.
-SDK_FILE_NAME="android-sdk_r20-linux.tgz"
+SDK_TARGET_VER=20
+
+SDK_FILE_NAME="android-sdk_r${SDK_TARGET_VER}-linux.tgz"
SDK_DOWNLOAD_URL="http://dl.google.com/android/${SDK_FILE_NAME}"
SDK_MD5SUM="22a81cf1d4a951c62f71a8758290e9bb"
@@ -96,21 +98,23 @@ if [[ ! -d "${ANDROID_SDK_ROOT}" ]]; then
$(dirname "${ANDROID_SDK_ROOT}"))
fi
+# Check the installed 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:]]*$//')
+
# Install the target if it doesn't exist. The package installed above contains
# no platform, platform-tool or tool, all those should be installed by
# ${ANDROID_SDK_ROOT}/tools/android.
+# Also, if current SDK version is lower than ${SDK_TARGET_VER}, upgrade the SDK.
found=$("${ANDROID_SDK_ROOT}/tools/android" list targets \
| grep "${SDK_TARGET_ID}" | wc -l)
-if [[ "$found" = "0" ]]; then
+if [[ "$found" = "0" || ${SDK_VER} -lt ${SDK_TARGET_VER} ]]; then
# Updates the SDK by installing the necessary components.
# From current configuration, all android platforms will be installed.
# This will take a little bit long time.
- echo "Install platform, platform-tool and tool ..."
+ echo "Upgrade SDK and install platform, platform-tool and tool ..."
- # 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