Skip to content

Commit

Permalink
remove android project / gradle build scripts for cmake only builds
Browse files Browse the repository at this point in the history
* Removes use of gradle in build-script.rs, not needed for build a purely native shared library and unifies code path to one cmake-only way of building the library
    * This change also fixes the issue of android builds on windows with openjdk compiler hangs indefinitely without running android-studio.

* Bump android compile-sdk from v34 to v35

* Bump android cmake from v3.22.0 to v3.30.3
  • Loading branch information
korejan committed Sep 21, 2024
1 parent 7d0eb53 commit 3c85915
Show file tree
Hide file tree
Showing 54 changed files with 182 additions and 1,333 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/prepare-alxr-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ jobs:
env:
RUST_BACKTRACE: 1
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/27.1.12297006
ANDROID_NDK_HOME: $ANDROID_NDK_ROOT
ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/27.1.12297006
ANDROID_CMAKE_BIN: /usr/local/lib/android/sdk/cmake/3.30.3/bin
JAVA_HOME: $JAVA_HOME_17_X64
steps:
- name: Checkout code
Expand All @@ -332,7 +333,7 @@ jobs:
sudo apt update && sudo apt upgrade -y
sudo apt install gcc-multilib
SDK_MANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
yes | sudo $SDK_MANAGER --install "ndk;27.1.12297006" "platforms;android-29"
yes | sudo $SDK_MANAGER --install "ndk;27.1.12297006" "platforms;android-29" "cmake;3.30.3"
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
cargo install cargo-apk --git https://github.com/korejan/cargo-apk.git --branch android-manifest-entries
Expand All @@ -344,13 +345,15 @@ jobs:
run: |
unset ANDROID_HOME
JAVA_HOME=$JAVA_HOME_17_X64
export PATH=$ANDROID_CMAKE_BIN:$PATH
cargo xtask build-alxr-android --generic --release
cargo clean
- name: Build & Package alxr-android-quest-release
run: |
unset ANDROID_HOME
JAVA_HOME=$JAVA_HOME_17_X64
export PATH=$ANDROID_CMAKE_BIN:$PATH
cargo xtask build-alxr-quest --release
cargo clean
Expand Down Expand Up @@ -387,7 +390,8 @@ jobs:
env:
RUST_BACKTRACE: 1
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/27.1.12297006
ANDROID_NDK_HOME: $ANDROID_NDK_ROOT
ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/27.1.12297006
ANDROID_CMAKE_BIN: /usr/local/lib/android/sdk/cmake/3.30.3/bin
JAVA_HOME: $JAVA_HOME_17_X64
steps:
- name: Checkout code
Expand All @@ -407,7 +411,7 @@ jobs:
sudo apt update && sudo apt upgrade -y
sudo apt install gcc-multilib
SDK_MANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
yes | sudo $SDK_MANAGER --install "ndk;27.1.12297006" "platforms;android-29"
yes | sudo $SDK_MANAGER --install "ndk;27.1.12297006" "platforms;android-29" "cmake;3.30.3"
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
cargo install cargo-apk --git https://github.com/korejan/cargo-apk.git --branch android-manifest-entries
Expand All @@ -419,6 +423,7 @@ jobs:
run: |
unset ANDROID_HOME
JAVA_HOME=$JAVA_HOME_17_X64
export PATH=$ANDROID_CMAKE_BIN:$PATH
cargo xtask build-alxr-android --generic
pushd ./build/debug/alxr_client_android
mv alxr-client.apk alxr-client-debug.apk
Expand All @@ -429,6 +434,7 @@ jobs:
run: |
unset ANDROID_HOME
JAVA_HOME=$JAVA_HOME_17_X64
export PATH=$ANDROID_CMAKE_BIN:$PATH
cargo xtask build-alxr-pico
pushd ./build/debug/alxr_client_android
mv alxr-client-pico.apk alxr-client-pico-debug.apk
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ jobs:
runs-on: ubuntu-22.04
env:
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/27.1.12297006
ANDROID_NDK_HOME: $ANDROID_NDK_ROOT
ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/27.1.12297006
ANDROID_CMAKE_BIN: /usr/local/lib/android/sdk/cmake/3.30.3/bin
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v3
Expand All @@ -226,7 +227,7 @@ jobs:
sudo apt install gcc-multilib
SDK_MANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
yes | sudo $SDK_MANAGER --install "ndk;27.1.12297006" "platforms;android-29"
yes | sudo $SDK_MANAGER --install "ndk;27.1.12297006" "platforms;android-29" "cmake;3.30.3"
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
cargo install cargo-apk --git https://github.com/korejan/cargo-apk.git --branch android-manifest-entries
Expand All @@ -238,12 +239,14 @@ jobs:
run: |
unset ANDROID_HOME
JAVA_HOME=$JAVA_HOME_17_X64
export PATH=$ANDROID_CMAKE_BIN:$PATH
cargo apk build -p alxr-client-android
- name: Build alxr-android-pico
run: |
unset ANDROID_HOME
JAVA_HOME=$JAVA_HOME_17_X64
export PATH=$ANDROID_CMAKE_BIN:$PATH
cargo apk build -p alxr-client-pico --target-dir=target/pico
tests:
Expand Down
90 changes: 50 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3c85915

Please sign in to comment.