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'"