Skip to content

Commit

Permalink
Updates all the things
Browse files Browse the repository at this point in the history
For each example, this:
- Updates to using Android Gradle Plugin 8.0
- Adds ndkVersion to build.gradle
- Updates all cargo deps and fixes / updates examples as needed
- Avoids depending on any git branches for winit/egui now that the
  required Android support is upstream.
- Removes all .idea files and adds .idea to .gitignore

Adds a na-egui example that tests NativeActivity + Egui
(same code as agdk-egui, but built against NativeActivity instead of
GameActivity)

This updates .github/workflows/ci.yml so all examples are built
and `./gradlew build` is run - not just `cargo ndk build`
  • Loading branch information
rib committed Jun 13, 2023
1 parent 872e722 commit 95c47f2
Show file tree
Hide file tree
Showing 212 changed files with 8,143 additions and 4,127 deletions.
111 changes: 81 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ name: ci

on:
push:
branches: [main]
pull_request:

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 --deny warnings"
RUSTDOCFLAGS: -Dwarnings

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust_version: [stable]
cargo_ndk_args: [-t arm64-v8a -t armeabi-v7a -t x86_64 -t x86 -o app/src/main/jniLibs/]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: hecrj/setup-rust-action@v1
with:
Expand Down Expand Up @@ -49,50 +48,102 @@ jobs:
# a shared target to speed up builds of all examples
run: mkdir shared-target

- name: Build na-mainloop example
working-directory: na-mainloop
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build agdk-mainloop example
working-directory: agdk-mainloop
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build na-mainloop example
working-directory: na-mainloop
- name: Build na-subclass-jni
working-directory: na-subclass-jni
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build na-winit-wgpu
working-directory: na-winit-wgpu
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build na-winit-glutin
working-directory: na-winit-glutin
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build agdk-winit-glutin
working-directory: na-winit-glutin
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build agdk-cpal
working-directory: agdk-cpal
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build agdk-oboe
working-directory: agdk-oboe
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build na-egui example
working-directory: na-egui
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build agdk-egui example
working-directory: agdk-egui
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build agdk-eframe example
working-directory: agdk-eframe
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build na-openxr-info example
working-directory: na-openxr-info
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build --features=android &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
- name: Build na-openxr-wgpu
working-directory: na-openxr-wgpu
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk ${{ matrix.cargo_ndk_args }} build &&
./gradlew build &&
find $GITHUB_WORKSPACE/shared-target -iname '*.so' -exec rm {} \;
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
Expand Down
7 changes: 1 addition & 6 deletions agdk-cpal/.gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea
.DS_Store
/build
/captures
Expand Down
3 changes: 0 additions & 3 deletions agdk-cpal/.idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions agdk-cpal/.idea/compiler.xml

This file was deleted.

20 changes: 0 additions & 20 deletions agdk-cpal/.idea/gradle.xml

This file was deleted.

9 changes: 0 additions & 9 deletions agdk-cpal/.idea/misc.xml

This file was deleted.

7 changes: 0 additions & 7 deletions agdk-cpal/.idea/vcs.xml

This file was deleted.

Loading

0 comments on commit 95c47f2

Please sign in to comment.