From e7e14d014d6bd9ebfa77e99328dc5f02277ef67d Mon Sep 17 00:00:00 2001 From: Maximilian Ammann Date: Sat, 23 Apr 2022 19:09:29 +0200 Subject: [PATCH] Remove cargo-apk --- .github/actions/android/action.yml | 4 ++-- docs/src/development-guide/building.md | 14 +++----------- justfile | 13 ++++++------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/actions/android/action.yml b/.github/actions/android/action.yml index 9f268711..347896ef 100644 --- a/.github/actions/android/action.yml +++ b/.github/actions/android/action.yml @@ -7,11 +7,11 @@ runs: - uses: extractions/setup-just@v1 - name: Install nightly toolchain shell: bash - run: just nightly-toolchain + run: just nightly-toolchain-android - uses: Swatinem/rust-cache@v1 - name: Build shell: bash - run: cd android/gradle && ./gradlew assembleDebug + run: just build-android - uses: actions/upload-artifact@v2 with: name: maplibre-rs.apk diff --git a/docs/src/development-guide/building.md b/docs/src/development-guide/building.md index 25d84424..f56cc359 100644 --- a/docs/src/development-guide/building.md +++ b/docs/src/development-guide/building.md @@ -10,23 +10,17 @@ cargo run --example desktop -- ## Android -First you have to install cargo-apk: - -```bash -cargo install cargo-apk -``` - -Next, you should make sure that a recent Android NDK is installed. You will need to set the `ANDROID_NDK_ROOT` variable +You should make sure that a recent Android NDK is installed. You will need to set the `ANDROID_NDK_ROOT` variable to something like this: ```bash export ANDROID_NDK_ROOT=$HOME/android-sdk/ndk/23.1.7779620/ ``` -After that you can run the app on a connected device using: +After that you can run the build the library: ``bash -cargo apk run --lib +just build-android `` ## iOS @@ -41,8 +35,6 @@ In order to run this app on macOS you have to open the Xcode project at `./apple You can then run the app on a macOS. During the Xcode build process cargo is used to build a static library for the required architecture. -*Hint: Right now only arm64/aarch64 devices are supported* - ## Web (WebGL, WebGPU) If you have a browser which already supports a recent version of the WebGPU specification then you can start a diff --git a/justfile b/justfile index b37e321a..1523d653 100644 --- a/justfile +++ b/justfile @@ -33,6 +33,10 @@ nightly-toolchain: rustup component add rust-src --toolchain $NIGHTLY_TOOLCHAIN rustup override set $NIGHTLY_TOOLCHAIN +nightly-toolchain-android: nightly-toolchain + rustup target add --toolchain $NIGHTLY_TOOLCHAIN x86_64-linux-android + rustup target add --toolchain $NIGHTLY_TOOLCHAIN aarch64-linux-android + webpack-webgl-production: nightly-toolchain cd web/web && npm install && npm run webgl-production-build @@ -68,14 +72,9 @@ webpack-production: nightly-toolchain #profile-bench: # cargo flamegraph --bench render -- --bench -install-cargo-apk: - cargo install cargo-apk -run-apk: print-android-env nightly-toolchain install-cargo-apk - cargo apk run -p maplibre-android --lib -Zbuild-std - -build-apk: print-android-env nightly-toolchain install-cargo-apk - cargo apk build -p maplibre-android --lib -Zbuild-std +build-android: print-android-env + cd android/gradle && ./gradlew assembleDebug # language=bash print-android-env: