From bcb33bb106ac7ff2818f457110ea4bcb202250bb Mon Sep 17 00:00:00 2001 From: nonlin-lin-chaos-order-etc-etal Date: Thu, 4 Apr 2024 14:08:24 +0800 Subject: [PATCH] Fix CI for #50 --- .github/workflows/android.yml | 11 ++++------- README.md | 1 + binary/jni/build_all.sh | 4 ++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 6cfe838..e8f727b 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -20,10 +20,9 @@ jobs: - name: Build required modules run: | export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313 - pushd app/jni - ./build_boost.sh - ./build_openssl.sh - ./build_miniupnpc.sh + pushd binary/jni + export BUILD_SO=1 + ./build_all.sh popd - name: Build with Gradle run: ./gradlew --no-daemon assembleDebug @@ -51,9 +50,7 @@ jobs: run: | export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313 pushd binary/jni - ./build_boost.sh - ./build_openssl.sh - ./build_miniupnpc.sh + ./build_all.sh popd - name: Build binaries with NDK run: | diff --git a/README.md b/README.md index fecc076..d871464 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ export ANDROID_HOME=/opt/android-sdk export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313 pushd binary/jni +export BUILD_SO=1 ./build_all.sh popd diff --git a/binary/jni/build_all.sh b/binary/jni/build_all.sh index bc693d5..a3d36da 100755 --- a/binary/jni/build_all.sh +++ b/binary/jni/build_all.sh @@ -5,5 +5,9 @@ fi ./build_boost.sh ./build_miniupnpc.sh ./build_openssl.sh +if [ -z "$BUILD_SO" -a "$BUILD_SO" == "" ]; then +export NDK_MODULE_PATH=`pwd` && export NDK_PROJECT_PATH=`pwd`/.. && $ANDROID_NDK_HOME/ndk-build V=1 NDK_LOG=1 -j`nproc` +else export NDK_MODULE_PATH=`pwd` && export NDK_PROJECT_PATH=`pwd`/.. && ./ndkbuild-wrapper.sh V=1 NDK_LOG=1 -j`nproc` +fi echo "$0 completed."