Skip to content

Commit

Permalink
upgrade ndk to 26.1.10909125
Browse files Browse the repository at this point in the history
  • Loading branch information
shiroedev2024 committed Apr 23, 2024
1 parent fd71879 commit fc94320
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,20 @@ jobs:
cargo install cbindgen
apt update && apt install -y make llvm-dev libclang-dev clang pkg-config unzip curl default-jdk build-essential
export ANDROID_HOME=/tmp/Android/sdk
export NDK_HOME=/tmp/Android/sdk/ndk/25.2.9519653
export NDK_HOME=/tmp/Android/sdk/ndk/26.1.10909125
export PATH=$ANDROID_HOME/cmdline-tools/bin:$PATH
cd /tmp/
curl -OL https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip
unzip commandlinetools-linux-6858069_latest.zip
mkdir -p $ANDROID_HOME
mv cmdline-tools $ANDROID_HOME
yes | sdkmanager --sdk_root=$ANDROID_HOME --licenses
sdkmanager --sdk_root=$ANDROID_HOME "ndk;25.2.9519653" "platforms;android-21"
sdkmanager --sdk_root=$ANDROID_HOME "ndk;26.1.10909125" "platforms;android-21"
- name: build
run: |
export ANDROID_HOME=/tmp/Android/sdk
export NDK_HOME=/tmp/Android/sdk/ndk/25.2.9519653
export NDK_HOME=/tmp/Android/sdk/ndk/26.1.10909125
./scripts/build_android.sh
- name: zip artifacts
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,20 @@ jobs:
cargo install cbindgen
apt update && apt install -y make llvm-dev libclang-dev clang pkg-config unzip curl default-jdk build-essential
export ANDROID_HOME=/tmp/Android/sdk
export NDK_HOME=/tmp/Android/sdk/ndk/25.2.9519653
export NDK_HOME=/tmp/Android/sdk/ndk/26.1.10909125
export PATH=$ANDROID_HOME/cmdline-tools/bin:$PATH
cd /tmp/
curl -OL https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip
unzip commandlinetools-linux-6858069_latest.zip
mkdir -p $ANDROID_HOME
mv cmdline-tools $ANDROID_HOME
yes | sdkmanager --sdk_root=$ANDROID_HOME --licenses
sdkmanager --sdk_root=$ANDROID_HOME "ndk;25.2.9519653" "platforms;android-21"
sdkmanager --sdk_root=$ANDROID_HOME "ndk;26.1.10909125" "platforms;android-21"
- name: build
run: |
export ANDROID_HOME=/tmp/Android/sdk
export NDK_HOME=/tmp/Android/sdk/ndk/25.2.9519653
export NDK_HOME=/tmp/Android/sdk/ndk/26.1.10909125
./scripts/build_android.sh
- name: zip artifacts
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ cli-dev:
cargo build -p leaf-cli

android:
NDK_HOME=~/Android/Sdk/ndk/23.1.7779620 ./scripts/build_android.sh
NDK_HOME=~/Android/Sdk/ndk/26.1.10909125 ./scripts/build_android.sh

android-dev:
NDK_HOME=~/Android/Sdk/ndk/23.1.7779620 ./scripts/build_android.sh debug
NDK_HOME=~/Android/Sdk/ndk/26.1.10909125 ./scripts/build_android.sh debug

android-ndk-dev:
ANDROID_NDK_HOME=~/Android/Sdk/ndk/26.1.10909125 CLANG_VERSION=17 cargo ndk -p 21 --no-strip --manifest-path leaf-ffi/Cargo.toml -t arm64-v8a -t armeabi-v7a -t x86 -t x86_64 -o target/jni-dev build
Expand Down
12 changes: 10 additions & 2 deletions scripts/build_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,19 @@ for target in $targets; do
cargo build -p $package --target $target $mode
done

android_libs=$BASE/../target/leaf-android-libs
if [ -z "$mode" ]; then
android_libs=$BASE/../target/leaf-android-libs-dev
else
android_libs=$BASE/../target/leaf-android-libs
fi

mkdir -p $android_libs
for target in $targets; do
mv $BASE/../target/$target/release/libleaf.so $android_libs/libleaf-$target.so
if [ -z "$mode" ]; then
mv "$BASE/../target/$target/debug/libleaf.so" "$android_libs/libleaf-$target.so"
else
mv "$BASE/../target/$target/release/libleaf.so" "$android_libs/libleaf-$target.so"
fi
done
cbindgen \
--config $BASE/../$package/cbindgen.toml \
Expand Down

0 comments on commit fc94320

Please sign in to comment.