From 11e501a300e40bc254780723e39869c7830944eb Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 15 Jul 2021 11:51:31 +0200 Subject: check ndk version earlier, do first the tor binary build job --- scripts/build_deps.sh | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'scripts') diff --git a/scripts/build_deps.sh b/scripts/build_deps.sh index 7c0bfa74..e865bd49 100755 --- a/scripts/build_deps.sh +++ b/scripts/build_deps.sh @@ -19,6 +19,27 @@ EXPECTED_NDK_VERSION="21.4.7075529" # look for empty dir cd $BASE_DIR + +if [[ $(ls -A ${DIR_TORLIBS}) ]] +then + echo "Dirty build: Reusing tor libraries" +else + echo "Clean build: compiling tor libraries" + if [[ ! -d $DIR_TORLIBS ]] + then + mkdir $DIR_TORLIBS + fi + cd ./tor-android + if [[ $NDK_VERSION == $EXPECTED_NDK_VERSION ]] + then + ./tor-droid-make.sh fetch -c || quit "failed to checkout tor dependencies" + ./tor-droid-make.sh build -b release || quit "failed to build tor release binaries" + else + quit "expected NDK VERSION: $EXPECTED_NDK_VERSION. But found: $NDK_VERSION" + fi + cd .. +fi + if [[ $(ls -A ${DIR_OVPNASSETS}) && $(ls -A ${DIR_OVPNLIBS}) ]] then echo "Dirty build: skipped externalNativeBuild - reusing existing libs" @@ -52,29 +73,5 @@ else cp lib/bitmaskcore_x86-sources.jar ../lib-bitmask-core-x86/. cp lib/bitmaskcore_x86_64.aar ../lib-bitmask-core-x86_64/. cp lib/bitmaskcore_x86_64-sources.jar ../lib-bitmask-core-x86_64/. - cd .. -fi - -if [[ $(ls -A ${DIR_TORLIBS}) ]] -then - echo "Dirty build: Reusing tor libraries" -else - echo "Clean build: compiling tor libraries" - if [[ ! -d $DIR_TORLIBS ]] - then - mkdir $DIR_TORLIBS - fi - - cd ./tor-android - - if [[ $NDK_VERSION == $EXPECTED_NDK_VERSION ]] - then - ./tor-droid-make.sh fetch -c || quit "failed to checkout tor dependencies" - ./tor-droid-make.sh build -b release || quit "failed to build tor release binaries" - else - quit "expected NDK VERSION: $EXPECTED_NDK_VERSION. But found: $NDK_VERSION" - fi - - cd .. fi \ No newline at end of file -- cgit v1.2.3