diff --git a/.travis.yml b/.travis.yml index 0aa941bd..6b0bf876 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ os: osx osx_image: xcode9.3 env: - - TARGET_PLATFORM=android - TARGET_PLATFORM=ios + - TARGET_PLATFORM=android ANDROID_API_LEVEL=27 ANDROID_BUILD_TOOLS_VERSION=28.0.3 cache: directories: @@ -23,9 +23,9 @@ install: - if [ $TARGET_PLATFORM = "android" ]; then brew update && brew install gradle && - scripts/setup-android-sdk.sh && + scripts/setup-android-sdk.sh -a $ANDROID_API_LEVEL -b $ANDROID_BUILD_TOOLS_VERSION && export ANDROID_HOME=$(pwd)/android-sdk-macosx && - export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/23.0.2; + export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION; fi script: diff --git a/scripts/setup-android-sdk.sh b/scripts/setup-android-sdk.sh index f100a9ac..83fe2de4 100755 --- a/scripts/setup-android-sdk.sh +++ b/scripts/setup-android-sdk.sh @@ -1,12 +1,19 @@ #!/usr/bin/env bash set -e +while getopts a:b: option; do + case "${option}" in + a) API_LEVEL=${OPTARG};; + b) BUILD_TOOLS_VERSION=${OPTARG};; + esac +done + curl http://dl.google.com/android/android-sdk_r24.4-macosx.zip -o android-sdk-macosx.zip tar -xvf android-sdk-macosx.zip echo y | ./android-sdk-macosx/tools/android update sdk --no-ui --all --filter platform-tools -echo y | ./android-sdk-macosx/tools/android update sdk --no-ui --all --filter build-tools-25.0.0 -echo y | ./android-sdk-macosx/tools/android update sdk --no-ui --all --filter android-25 +echo y | ./android-sdk-macosx/tools/android update sdk --no-ui --all --filter build-tools-${BUILD_TOOLS_VERSION} +echo y | ./android-sdk-macosx/tools/android update sdk --no-ui --all --filter android-${API_LEVEL} echo y | ./android-sdk-macosx/tools/android update sdk --no-ui --all --filter extra-android-support echo y | ./android-sdk-macosx/tools/android update sdk --no-ui --all --filter extra-android-m2repository echo y | ./android-sdk-macosx/tools/android update sdk --no-ui --all --filter extra-google-m2repository