From c875cda3996ab6168bb9a4d6f10951456e5707c1 Mon Sep 17 00:00:00 2001 From: talregev Date: Fri, 3 Jul 2020 18:40:14 +0300 Subject: [PATCH] Fix createNDKFolder for CI --- android/buildAndroidBOINC-CI.sh | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/android/buildAndroidBOINC-CI.sh b/android/buildAndroidBOINC-CI.sh index fe6ed14756..dc4f49d5b5 100755 --- a/android/buildAndroidBOINC-CI.sh +++ b/android/buildAndroidBOINC-CI.sh @@ -137,18 +137,33 @@ export COMPILECURL="no" export NDK_FLAGFILE="$PREFIX/NDK-${NDK_VERSION}-${arch}_done" export CURL_FLAGFILE="$PREFIX/curl-${CURL_VERSION}-${arch}_done" export OPENSSL_FLAGFILE="$PREFIX/openssl-${OPENSSL_VERSION}-${arch}_done" -export CREATE_NDK_FOLDER=${CREATE_NDK_FOLDER:-"no"} +export CREATED_NDK_FOLDER=${CREATED_NDK_FOLDER:-"no"} -if [ ! -e "${NDK_FLAGFILE}" ]; then - rm -rf $OPENSSL_FLAGFILE - rm -rf $CURL_FLAGFILE - if [ $CREATE_NDK_FOLDER = "no" ]; then +createNDKFolder() +{ + if [ $CREATED_NDK_FOLDER = "no" ]; then rm -rf "$BUILD_DIR/android-ndk-r${NDK_VERSION}" wget -c --no-verbose -O /tmp/ndk.zip https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux-x86_64.zip - unzip -qq /tmp/ndk_${NDK_VERSION}.zip -d $BUILD_DIR - export CREATE_NDK_FOLDER="yes" + unzip -qq /tmp/ndk.zip -d $BUILD_DIR + export CREATED_NDK_FOLDER="yes" + touch "${NDK_FLAGFILE}" + fi +} + +if [ ci = "yes" ]; then + if [ ! -e "${NDK_FLAGFILE}" ]; then + rm -rf $OPENSSL_FLAGFILE + rm -rf $CURL_FLAGFILE + export CREATED_NDK_FOLDER="no" + fi + createNDKFolder +else + if [ ! -e "${NDK_FLAGFILE}" ]; then + rm -rf $OPENSSL_FLAGFILE + rm -rf $CURL_FLAGFILE + export CREATED_NDK_FOLDER="no" + createNDKFolder fi - touch "${NDK_FLAGFILE}" fi export NDK_ROOT=$BUILD_DIR/android-ndk-r${NDK_VERSION}