diff options
author | cyberta <cyberta@riseup.net> | 2021-02-02 15:36:46 +0000 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2021-02-02 15:36:46 +0000 |
commit | 50588d08d77529eb84686220cfe3c8816195d46b (patch) | |
tree | ea8a367135749d0012be6a4c78e4284e679e93e7 /scripts/build_deps.sh | |
parent | f425762e35957e663eeda3e5bea73a1f93ab90dd (diff) | |
parent | eba2108802a4b6251419b02c2f0ca47c0a701653 (diff) |
Merge branch 'move_scripts' into 'master'
Move scripts
See merge request leap/bitmask_android!120
Diffstat (limited to 'scripts/build_deps.sh')
-rwxr-xr-x | scripts/build_deps.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/build_deps.sh b/scripts/build_deps.sh new file mode 100755 index 00000000..1785fca8 --- /dev/null +++ b/scripts/build_deps.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +function quit { + echo "Task failed. $1." + exit 1 +} + +SCRIPT_DIR=$(dirname "$0") +BASE_DIR="$SCRIPT_DIR/.." +DIR_OVPNASSETS=./ics-openvpn/main/build/ovpnassets +DIR_OVPNLIBS=./ics-openvpn/main/build/intermediates/cmake/noovpn3/release/obj +DIR_GOLIBS=./go/lib/ +FILE_X86=./go/out/x86/piedispatcherlib +FILE_ARM=./go/out/armeabi-v7a/piedispatcherlib + +# init +# look for empty dir + +cd $BASE_DIR +if [[ $(ls -A ${DIR_OVPNASSETS}) && $(ls -A ${DIR_OVPNLIBS}) ]] +then + echo "Dirty build: skipped externalNativeBuild - reusing existing libs" +else + echo "Clean build: starting externalNativeBuild" + cd ./ics-openvpn || quit "Directory ics-opevpn not found" + ./gradlew clean main:externalNativeBuildCleanSkeletonRelease main:externalNativeBuildSkeletonRelease --debug --stacktrace || quit "Build ics-openvpn native libraries failed" + cd .. +fi + +if [[ $(ls -A ${DIR_GOLIBS}) ]] +then + echo "Dirty build: Reusing go libraries" +else + echo "Clean build: compiling Go libraries" + cd ./go || quit "Directory go not found" + ./install_go.sh || quit "install_go.sh failed" + ./android_build_web_core.sh || quit "android_build_web_core.sh (shapeshifter + pgpverify) failed" + ./android_build_core.sh || quit "android build core (shapeshifter) failed" + cd .. +fi |