From c9384762ee367f890a3de57ff3270d8f9c445866 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 21 Jul 2017 08:26:56 -0700 Subject: [PATCH] Fix NDK build, Take II Summary: There was one incorrect path and some caching problems. I hope this will take care of it for good. Reviewed By: emilsjolander Differential Revision: D5470120 fbshipit-source-id: 17c9e783c952c92fa5c2ccfb18107a59d8a80e3d --- .travis.yml | 2 +- scripts/android-setup.sh | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 91f79aac..a25f2e67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,7 +76,7 @@ before_install: source scripts/android-setup.sh && installAndroidSDK export ANDROID_SDK=$ANDROID_HOME export ANDROID_NDK_REPOSITORY=$HOME/android-ndk - export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-13b + export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-r13b fi # JavaScript diff --git a/scripts/android-setup.sh b/scripts/android-setup.sh index 0ed7adc6..71c2e923 100644 --- a/scripts/android-setup.sh +++ b/scripts/android-setup.sh @@ -17,7 +17,7 @@ function installsdk() { PROXY_ARGS="--proxy=http --proxy_host=$PROXY_HOST --proxy_port=$PROXY_PORT" fi - yes | $ANDROID_HOME/tools/bin/sdkmanager $PROXY_ARGS $@ + yes | "$ANDROID_HOME/tools/bin/sdkmanager" $PROXY_ARGS $@ } function installAndroidSDK { @@ -25,24 +25,24 @@ function installAndroidSDK { 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 + if [[ ! -f "$ANDROID_HOME/tools/bin/sdkmanager" ]]; then TMP=/tmp/sdk$$.zip download 'https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip' $TMP - unzip -qod $ANDROID_HOME $TMP + unzip -qod "$ANDROID_HOME" "$TMP" rm $TMP fi - if [[ ! -d "$ANDROID_NDK_REPOSITORY" ]]; then + if [[ ! -d "$ANDROID_NDK_REPOSITORY/android-ndk-r13b" ]]; then TMP=/tmp/ndk$$.zip - mkdir -p $ANDROID_NDK_REPOSITORY + 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 + 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 + mkdir -p "$ANDROID_HOME/licenses/" + echo > "$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' 'platform-tools' 'platforms;android-23' 'platforms;android-25' 'extras;android;m2repository' }