From 08f8add81d3b84aa9efdff62be59e0ce141912f6 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Fri, 26 Mar 2021 22:32:18 +0300 Subject: [PATCH] Fix cache. Add info when we delete android_tc folder. Add info to test. --- android/buildAndroidBOINC-CI.sh | 61 ++++++++++++++++++++------------- android/build_apps.sh | 3 -- android/build_client.sh | 2 -- 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/android/buildAndroidBOINC-CI.sh b/android/buildAndroidBOINC-CI.sh index d4c62eab99..4986dc6bbd 100755 --- a/android/buildAndroidBOINC-CI.sh +++ b/android/buildAndroidBOINC-CI.sh @@ -21,15 +21,12 @@ set -e # When you want to invalidate openssl and curl without change their versions. export REV=1 +export ARMV6_REV=1 export OPENSSL_VERSION=1.0.2s export CURL_VERSION=7.62.0 export NDK_VERSION=21d export NDK_ARMV6_VERSION=15c -export ANDROID_HOME=$HOME/Android/Sdk -export NDK_ROOT=$HOME/Android/Ndk -export ANDROID_TC=$HOME/Android/Toolchains - # checks if a given path is canonical (absolute and does not contain relative links) # from http://unix.stackexchange.com/a/256437 isPathCanonical() { @@ -142,9 +139,9 @@ fi export COMPILEOPENSSL="no" export COMPILECURL="no" -export NDK_FLAGFILE="$PREFIX/NDK-${NDK_VERSION}_done" -export NDK_CI_FLAGFILE="$PREFIX/NDK-${NDK_VERSION}-${arch}-${REV}_done" -export NDK_ARMV6_FLAGFILE="$PREFIX/NDK-${NDK_ARMV6_VERSION}_armv6_done" +export ANDROID_TC_FLAGFILE="$PREFIX/ANDROID_TC_WITH_NDK-${NDK_VERSION}-${arch}-${REV}_done" +export NDK_FLAGFILE="$PREFIX/NDK-${NDK_VERSION}-${REV}_done" +export NDK_ARMV6_FLAGFILE="$PREFIX/NDK-${NDK_ARMV6_VERSION}-armv6-${ARMV6_REV}_done" export CREATED_NDK_FOLDER=${CREATED_NDK_FOLDER:-"no"} if [ "$arch" = armv6 ]; then @@ -157,35 +154,49 @@ fi createNDKFolder() { - if [ $CREATED_NDK_FOLDER = "no" ]; then - rm -rf "$BUILD_DIR/android-ndk-r${NDK_VERSION}" - wget -c --no-verbose -O /tmp/ndk_${NDK_VERSION}.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 CREATED_NDK_FOLDER="yes" - fi + rm -rf "$BUILD_DIR/android-ndk-r${NDK_VERSION}" + wget -c --no-verbose -O /tmp/ndk_${NDK_VERSION}.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 +} + +createNDKARMV6Folder() +{ + rm -rf "$BUILD_DIR/android-ndk-r${NDK_ARMV6_VERSION}" + wget -c --no-verbose -O /tmp/ndk_armv6_${NDK_ARMV6_VERSION}.zip https://dl.google.com/android/repository/android-ndk-r${NDK_ARMV6_VERSION}-linux-x86_64.zip + unzip -qq /tmp/ndk_armv6_${NDK_ARMV6_VERSION}.zip -d $BUILD_DIR } if [ "$ci" = "yes" ]; then - if [ ! -e "${NDK_CI_FLAGFILE}" ]; then - rm -rf "${PREFIX}/${arch}" - rm -rf "${OPENSSL_FLAGFILE}" - rm -rf "${CURL_FLAGFILE}" - touch "${NDK_CI_FLAGFILE}" + if [ $CREATED_NDK_FOLDER = "no" ]; then + createNDKFolder + export $CREATED_NDK_FOLDER="yes" fi - createNDKFolder else if [ ! -e "${NDK_FLAGFILE}" ]; then - export CREATED_NDK_FOLDER="no" createNDKFolder touch "${NDK_FLAGFILE}" fi fi +if [ ! -e "${ANDROID_TC_FLAGFILE}" ]; then + if [ $arch != "armv6" ]; then + rm -rf "${PREFIX}/${arch}" + echo delete "${PREFIX}/${arch}" + rm -rf "${OPENSSL_FLAGFILE}" + rm -rf "${CURL_FLAGFILE}" + touch ${ANDROID_TC_FLAGFILE} + fi +fi + if [ ! -e "${NDK_ARMV6_FLAGFILE}" ]; then - rm -rf "$BUILD_DIR/android-ndk-r${NDK_ARMV6_VERSION}" - wget -c --no-verbose -O /tmp/ndk_armv6_${NDK_ARMV6_VERSION}.zip https://dl.google.com/android/repository/android-ndk-r${NDK_ARMV6_VERSION}-linux-x86_64.zip - unzip -qq /tmp/ndk_armv6_${NDK_ARMV6_VERSION}.zip -d $BUILD_DIR - touch "${NDK_ARMV6_FLAGFILE}" + if [ $arch = "armv6" ]; then + rm -rf "${PREFIX}/${arch}" + echo delete "${PREFIX}/${arch}" + rm -rf "${OPENSSL_FLAGFILE}" + rm -rf "${CURL_FLAGFILE}" + createNDKARMV6Folder + touch "${NDK_ARMV6_FLAGFILE}" + fi fi export NDK_ROOT=$BUILD_DIR/android-ndk-r${NDK_VERSION} @@ -215,6 +226,7 @@ NeonTest() { while [ $# -gt 0 ]; do if [ $(readelf -A $(find $ANDROID_TC/${arch} -type f -name "$1") | grep -i neon | head -c1 | wc -c) -ne 0 ]; then + echo $(readelf -A $(find $ANDROID_TC/${arch} -type f -name "$1") | grep -i neon) echo [ERROR] "$1" contains neon optimization exit 1 fi @@ -236,6 +248,7 @@ Armv6Test() { while [ $# -gt 0 ]; do if [ $(readelf -A $(find $ANDROID_TC/armv6 "BOINC/app/src/main/assets/armeabi" "../samples" -type f -name "$1") | grep -i "Tag_CPU_arch: v6" | head -c1 | wc -c) -eq 0 ]; then + echo $(readelf -A $(find $ANDROID_TC/armv6 "BOINC/app/src/main/assets/armeabi" "../samples" -type f -name "$1") | grep -i "Tag_CPU_arch:") echo [ERROR] "$1" is not armv6 cpu arch exit 1 fi diff --git a/android/build_apps.sh b/android/build_apps.sh index c0ee968408..274c24e7ab 100755 --- a/android/build_apps.sh +++ b/android/build_apps.sh @@ -8,9 +8,6 @@ fi export VERBOSE="no" -BUILD_DIR="$PWD/3rdParty/buildCache" - echo '===== BOINC apps for all platforms build start =====' android/build_component.sh --component apps echo '===== BOINC apps for all platforms build done =====' - diff --git a/android/build_client.sh b/android/build_client.sh index 9e2f5e116b..5938ecc507 100755 --- a/android/build_client.sh +++ b/android/build_client.sh @@ -15,8 +15,6 @@ fi export VERBOSE="no" -BUILD_DIR="$PWD/3rdParty/buildCache" - echo '===== BOINC Client for all platforms build start =====' android/build_component.sh --component client echo '===== BOINC Client for all platforms build done ====='