Fix NDK download in Travis

Summary:
After about 500MB, Travis seems to kill the TLS connection. Could be a traffic
limit, could be a timeout. I've only seen this for their MacOS boxes. We're now
retrying a few times with curl, which seems to work.

Reviewed By: emilsjolander

Differential Revision: D6051024

fbshipit-source-id: feb73bfb9fd81b2a8b9b4d33d4e9f230a9899a66
This commit is contained in:
Pascal Hartig
2017-10-13 06:43:19 -07:00
committed by Facebook Github Bot
parent 208b70a93c
commit be94a5ef8d
2 changed files with 4 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ before_install:
source scripts/android-setup.sh && installAndroidSDK source scripts/android-setup.sh && installAndroidSDK
export ANDROID_SDK=$ANDROID_HOME export ANDROID_SDK=$ANDROID_HOME
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-r13b export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-r15c
fi fi
# JavaScript # JavaScript

View File

@@ -1,8 +1,9 @@
function download() { function download() {
echo "Downloading '$1' to '$2' ..."
if hash curl 2>/dev/null; then if hash curl 2>/dev/null; then
curl -L -o $2 $1 curl --retry 10 -L -o "$2" "$1"
elif hash wget 2>/dev/null; then elif hash wget 2>/dev/null; then
wget -O $2 $1 wget -O "$2" "$1"
else else
echo >&2 "No supported download tool installed. Please get either wget or curl." echo >&2 "No supported download tool installed. Please get either wget or curl."
exit exit