Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make rust core use NDK >= r23 #1086

Merged
merged 13 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
- if: matrix.language == 'java'
name: Build Android
run: |
export NDK_HOME=$ANDROID_NDK_LATEST_HOME
JJ marked this conversation as resolved.
Show resolved Hide resolved
./build.js
cd platform/android
make -C ../core android_bindings
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/daily-instrumentation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
run: ./build.js build
- name: Build core
working-directory: platform/core
run: make
run: |
export NDK_HOME=$ANDROID_NDK_LATEST_HOME
make android_bindings
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: ./build.js
- name: Build core
working-directory: platform/core
run: make
run: make ios_bindings
- name: Build and test iOS
working-directory: platform/ios
run: make test
4 changes: 3 additions & 1 deletion .github/workflows/js-and-android-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ jobs:
- name: Build core with Android bindings
if: steps.changes.outputs.android == 'true'
working-directory: platform/core
run: make android_bindings
run: |
export NDK_HOME=$ANDROID_NDK_LATEST_HOME
make android_bindings
- name: Test android
if: steps.changes.outputs.android == 'true'
working-directory: platform/android
Expand Down
19 changes: 4 additions & 15 deletions platform/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,13 @@ ios_targets := iPhone simulator
tools_dir := tools
android_core := PolyPodCoreAndroid/core/src/main/
android_version := 24
# Rust still uses old-ish r22 version of NDK.
# For reference https://github.com/rust-lang/rust/pull/85806
ndk_version := r22b
google_repo := https://dl.google.com/android/repository
ndk_lib := android-ndk-$(ndk_version)
ndk=$(tools_dir)/NDK_$(ndk_version)
ndk_archive = $(tools_dir)/NDK.zip
export ANDROID_NDK_HOME := $(ndk)/$(ndk_lib)
android_triples := aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
android_binaries := $(patsubst %, target/%, $(android_triples))
android_architectures := arm64-v8a armeabi-v7a x86_64 x86
jni_libs_copy_path := $(android_core)/jniLibs
android_core_libraries := $(patsubst %, $(jni_libs_copy_path)/%, $(android_architectures))
cargo_ndk_version = 2.10.0

ifeq ($(OS),Windows_NT)
ndk_download_url = $(google_repo)/$(ndk_lib)-windows-x86_64.zip
Expand All @@ -45,6 +39,7 @@ else
endif



# ============ Rust core ============ #

$(target):
Expand Down Expand Up @@ -100,14 +95,8 @@ endef

# ============ Android lib ============ #

$(ndk):
mkdir -p $(ndk)
curl -L $(ndk_download_url) -o $(ndk_archive)
unzip -q -d $(ndk) $(ndk_archive)
rm $(ndk_archive)

$(android_binaries): $(target) $(ndk)
cargo install cargo-ndk
$(android_binaries): $(target)
cargo install cargo-ndk --version $(cargo_ndk_version)
rustup target add $(android_triples)

$(foreach triple, $(android_triples), \
Expand Down
2 changes: 2 additions & 0 deletions platform/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ make ios_bindings

- Building android core:

Prerequisite: You should install NDK (it is recommended to use Android Studio for installing it). Version r24 should be installed. Make sure that either `NDK_HOME` or `ANDROID_NDK_HOME`(specifying the path to NDK) is exported as an environment variable on your system.

```shell
make android_bindings
```
Expand Down

This file was deleted.