Fix Android Actions (#3)
* Add android * Update android pipeline * Update JDK * set up toolchain * Update abi * More deps * Add more target
This commit is contained in:
parent
a4a136b6a9
commit
ee00d39c79
|
@ -25,24 +25,35 @@ jobs:
|
|||
path: hello/target/HelloFFI.xcframework
|
||||
retention-days: 7
|
||||
|
||||
# build_android:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# with:
|
||||
# lfs: true
|
||||
# - uses: actions/setup-java@v2
|
||||
# with:
|
||||
# distribution: 'microsoft'
|
||||
# java-version: '11'
|
||||
# - name: Setup Android SDK
|
||||
# uses: android-actions/setup-android@v2
|
||||
# - uses: nttld/setup-ndk@v1
|
||||
# with:
|
||||
# ndk-version: r21e
|
||||
# - name: "Build Android library"
|
||||
# env:
|
||||
# ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
# run: |
|
||||
# cd hello/platforms/android/UniffiRustExample
|
||||
# ./gradlew cargoBuild --info
|
||||
build_android:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
cache: 'gradle'
|
||||
# Reference: https://github.com/mozilla/rust-android-gradle/blob/master/.github/workflows/check.yml
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v2
|
||||
- uses: nttld/setup-ndk@v1
|
||||
with:
|
||||
ndk-version: r21e
|
||||
- uses: actions-rs/toolchain@v1
|
||||
# Reference: https://github.com/rust-windowing/android-ndk-rs/blob/master/.github/workflows/rust.yml
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
target: aarch64-linux-android
|
||||
- name: "More dependencies"
|
||||
run: |
|
||||
make prepare-android
|
||||
- name: "Build Android library"
|
||||
env:
|
||||
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
run: |
|
||||
cd hello/platforms/android/UniffiRustExample
|
||||
./gradlew cargoBuild --info
|
||||
|
|
14
Makefile
14
Makefile
|
@ -3,4 +3,16 @@ prepare-apple:
|
|||
rustup toolchain install nightly
|
||||
rustup target add aarch64-apple-ios-sim --toolchain nightly && rustup target add aarch64-apple-ios x86_64-apple-ios
|
||||
rustup component add rust-src --toolchain nightly
|
||||
cargo install uniffi_bindgen
|
||||
make install-uniffi-bindgen
|
||||
|
||||
prepare-android:
|
||||
rustup toolchain install stable
|
||||
rustup target add x86_64-linux-android
|
||||
rustup target add x86_64-unknown-linux-gnu
|
||||
rustup target add aarch64-linux-android
|
||||
rustup target add armv7-linux-androideabi
|
||||
rustup target add i686-linux-android
|
||||
make install-uniffi-bindgen
|
||||
|
||||
install-uniffi-bindgen:
|
||||
cargo install uniffi_bindgen --version 0.17.0
|
Loading…
Reference in New Issue