Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -e |
| 3 | set -x |
| 4 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 5 | GRADLE_VERSION=2.10 |
| 6 | SDK_VERSION=24.4.1 |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 7 | BUILD_TOOLS_VERSION=21.1.2 |
| 8 | COMPILE_SDK_VERSION=21 |
| 9 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 10 | SDK=android-sdk-linux |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 11 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 12 | export ANDROID_HOME=`pwd`/$SDK |
| 13 | export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools |
| 14 | |
| 15 | if [ ! -d $SDK ]; then |
| 16 | wget -nv http://dl.google.com/android/android-sdk_r$SDK_VERSION-linux.tgz |
| 17 | tar zxf android-sdk_r$SDK_VERSION-linux.tgz |
| 18 | rm android-sdk_r$SDK_VERSION-linux.tgz |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 19 | |
| 20 | echo "y" | android update sdk --filter platform-tools,build-tools-$BUILD_TOOLS_VERSION,android-$COMPILE_SDK_VERSION,extra-android-support,extra-android-m2repository,extra-google-m2repository --no-ui --all --force |
| 21 | echo "y" | android update sdk --filter "android-19" --no-ui --all --force |
| 22 | fi |
| 23 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 24 | if [ ! -d gradle-$GRADLE_VERSION ]; then |
| 25 | wget -nv https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip |
| 26 | unzip gradle-$GRADLE_VERSION-bin.zip |
| 27 | rm gradle-$GRADLE_VERSION-bin.zip |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 28 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 29 | ln -s `pwd`/gradle-$GRADLE_VERSION/bin/gradle gradle |
| 30 | fi |
| 31 | |
| 32 | echo sdk.dir=`pwd`/$SDK >> local.properties |