summaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2011-08-20 11:11:49 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2011-08-20 11:11:49 +0000
commit82fa47dd0653f21e41bfdea7c50d78bea375033f (patch)
treef8093380eab468e3231ab95521d477cc46f7b216 /android
parentfca9518fa47aafd0069a575478e5e792d2fa255c (diff)
downloadrockbox-82fa47dd0653f21e41bfdea7c50d78bea375033f.tar.gz
rockbox-82fa47dd0653f21e41bfdea7c50d78bea375033f.tar.bz2
rockbox-82fa47dd0653f21e41bfdea7c50d78bea375033f.zip
Android tools: Allow discovery of download URLs
Automatically discover the latest and greatest version of the Android SDK and NDK by fetching it from the index. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30334 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'android')
-rwxr-xr-xandroid/installToolchain.sh28
1 files changed, 14 insertions, 14 deletions
diff --git a/android/installToolchain.sh b/android/installToolchain.sh
index 18b2143248..6feeb95366 100755
--- a/android/installToolchain.sh
+++ b/android/installToolchain.sh
@@ -6,32 +6,32 @@
# it stopped
set -e
-# http://developer.android.com/sdk/index.html
-SDK_URL_LNX="http://dl.google.com/android/android-sdk_r11-linux_x86.tgz"
-SDK_URL_MAC="http://dl.google.com/android/android-sdk_r11-mac_x86.zip"
-SDK_URL_WIN="http://dl.google.com/android/android-sdk_r11-windows.zip"
-# http://developer.android.com/sdk/ndk/index.html
-NDK_URL_LNX="http://dl.google.com/android/ndk/android-ndk-r5c-linux-x86.tar.bz2"
-NDK_URL_MAC="http://dl.google.com/android/ndk/android-ndk-r5c-darwin-x86.tar.bz2"
-NDK_URL_WIN="http://dl.google.com/android/ndk/android-ndk-r5c-windows.zip"
+SDK_DOWNLOAD_URL="http://developer.android.com/sdk/index.html"
+NDK_DOWNLOAD_URL="http://developer.android.com/sdk/ndk/index.html"
+
+find_url() {
+ base_url="$1"
+ os="$2"
+ wget -q -O - $base_url | grep dl.google.com | sed 's/.*"\(http:\/\/.*\)".*/\1/' | grep $os | grep -v .exe # Windows hack
+}
OS=`uname`
case $OS in
Linux)
- SDK_URL=$SDK_URL_LNX
- NDK_URL=$NDK_URL_LNX
+ SDK_URL=$(find_url $SDK_DOWNLOAD_URL linux)
+ NDK_URL=$(find_url $NDK_DOWNLOAD_URL linux)
ANDROID=tools/android
;;
Darwin)
- SDK_URL=$SDK_URL_MAC
- NDK_URL=$NDK_URL_MAC
+ SDK_URL=$(find_url $SDK_DOWNLOAD_URL mac)
+ NDK_URL=$(find_url $NDK_DOWNLOAD_URL darwin)
ANDROID=tools/android
;;
CYGWIN*)
- SDK_URL=$SDK_URL_WIN
- NDK_URL=$NDK_URL_WIN
+ SDK_URL=$(find_url $SDK_DOWNLOAD_URL windows)
+ NDK_URL=$(find_url $NDK_DOWNLOAD_URL windows)
ANDROID=tools/android.bat
;;
esac