Fix travis NDK setup

Summary:
Phew, this took a while. Buck had some changes in how it picks up SDK/NDK
configs.

In order to satisfy the new demands, I'm now installing the NDK manually and no
longer through the SDK manager. I'm also trying to cache as much as possible to
reduce the flakiness here.

Reviewed By: emilsjolander

Differential Revision: D5465206

fbshipit-source-id: 61a4b9006fe96fc9a99fb9d75b822589064a9d1a
This commit is contained in:
Pascal Hartig
2017-07-21 03:07:01 -07:00
committed by Facebook Github Bot
parent 154e67adbc
commit 7ea50439ce
3 changed files with 23 additions and 8 deletions

View File

@@ -21,17 +21,28 @@ function installsdk() {
}
function installAndroidSDK {
TMP=/tmp/sdk$$.zip
download 'https://dl.google.com/android/repository/tools_r25.2.3-linux.zip' $TMP
unzip -d $HOME/android-sdk $TMP
rm $TMP
export ANDROID_HOME=$HOME/android-sdk
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$PATH"
if [[ ! -d "$ANDROID_HOME" ]]; then
TMP=/tmp/sdk$$.zip
download 'https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip' $TMP
unzip -qod $ANDROID_HOME $TMP
rm $TMP
fi
if [[ ! -d "$ANDROID_NDK_REPOSITORY" ]]; then
TMP=/tmp/ndk$$.zip
mkdir -p $ANDROID_NDK_REPOSITORY
download 'https://dl.google.com/android/repository/android-ndk-r13b-darwin-x86_64.zip' $TMP
unzip -qod $ANDROID_NDK_REPOSITORY $TMP
rm $TMP
fi
mkdir -p $ANDROID_HOME/licenses/
echo > $ANDROID_HOME/licenses/android-sdk-license
echo -n 8933bad161af4178b1185d1a37fbf41ea5269c55 > $ANDROID_HOME/licenses/android-sdk-license
echo -n 8933bad161af4178b1185d1a37fbf41ea5269c55 >> $ANDROID_HOME/licenses/android-sdk-license
installsdk 'build-tools;23.0.2' 'build-tools;25.0.2' 'build-tools;25.0.1' 'platforms;android-23' 'platforms;android-25' 'ndk-bundle' 'extras;android;m2repository'
installsdk 'build-tools;23.0.2' 'build-tools;25.0.2' 'build-tools;25.0.1' 'platform-tools' 'platforms;android-23' 'platforms;android-25' 'extras;android;m2repository'
}