From e93e7437653f70d4bbb370ce1d17b3a4a51609fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 3 Jan 2025 17:54:44 +0100 Subject: [PATCH] apply requested fixes --- scripts/build-android.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/build-android.sh b/scripts/build-android.sh index 5cf3233..298e909 100644 --- a/scripts/build-android.sh +++ b/scripts/build-android.sh @@ -12,6 +12,13 @@ mkdir -p $JNI_DIR # Set up cargo-ndk cargo install cargo-ndk --locked +# Add targets +rustup target add \ + aarch64-linux-android \ + armv7-linux-androideabi \ + x86_64-linux-android \ + i686-linux-android + # Build the android libraries in the jniLibs directory if [ "$#" -eq 0 ]; then cargo ndk -o $JNI_DIR \ @@ -21,20 +28,19 @@ if [ "$#" -eq 0 ]; then -t x86 \ -t x86_64 \ build --release + # Archive the dynamic libs cd $JNI_DIR || exit tar -czvf ../EmbeddedMilliAndroid.tar.gz ./* + cd - || exit + # Cleanup rm -rf $JNI_DIR elif [ "$1" = "x86" ]; then - rustup target add i686-linux-android cargo ndk -o $JNI_DIR --manifest-path ../Cargo.toml -t x86 build --release elif [ "$1" = "x64" ]; then - rustup target add x86_64-linux-android cargo ndk -o $JNI_DIR --manifest-path ../Cargo.toml -t x86_64 build --release elif [ "$1" = "armv7" ]; then - rustup target add armv7-linux-androideabi cargo ndk -o $JNI_DIR --manifest-path ../Cargo.toml -t armeabi-v7a build --release elif [ "$1" = "arm64" ]; then - rustup target add aarch64-linux-android cargo ndk -o $JNI_DIR --manifest-path ../Cargo.toml -t arm64-v8a build --release else echo "Invalid architecture: '$1'"