diff --git a/.github/workflows/validation-jobs.yml b/.github/workflows/validation-jobs.yml index 023fad1604..7a35bf314e 100644 --- a/.github/workflows/validation-jobs.yml +++ b/.github/workflows/validation-jobs.yml @@ -54,7 +54,7 @@ jobs: run: cargo install --force cargo-apk - name: Build APK - run: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME cargo apk build --example android_example + run: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME cargo apk build --package bevy-android-example run-examples-on-windows-dx12: runs-on: windows-latest diff --git a/Cargo.toml b/Cargo.toml index 97069bad9a..c6ec1f14d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ repository = "https://github.com/bevyengine/bevy" exclude = ["benches", "crates/bevy_ecs_compile_fail_tests"] members = [ "crates/*", + "examples/android", "examples/ios", "tools/ci", "tools/spancmp", @@ -1607,29 +1608,6 @@ description = "Demonstrates resizing and responding to resizing a window" category = "Window" wasm = true -# Android -[[example]] -crate-type = ["cdylib"] -name = "android_example" -path = "examples/android/android.rs" - -[package.metadata.example.android_example] -hidden = true - -[package.metadata.android] -package = "org.bevyengine.example" -apk_name = "bevyexample" -assets = "assets" -resources = "assets/android-res" -build_targets = ["aarch64-linux-android", "armv7-linux-androideabi"] - -[package.metadata.android.sdk] -target_sdk_version = 31 - -[package.metadata.android.application] -icon = "@mipmap/ic_launcher" -label = "Bevy Example" - [profile.wasm-release] inherits = "release" opt-level = "z" diff --git a/examples/android/Cargo.toml b/examples/android/Cargo.toml new file mode 100644 index 0000000000..6f8cd0074a --- /dev/null +++ b/examples/android/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "bevy-android-example" +version = "0.1.0" +edition = "2021" +description = "Example for building an Android app with Bevy" +publish = false +license = "MIT OR Apache-2.0" + +[lib] +name = "bevy_android_example" +crate-type = ["cdylib"] + +[dependencies] +bevy = { path = "../../" } + +[package.metadata.android] +package = "org.bevyengine.example" +apk_name = "bevyexample" +assets = "../../assets" +resources = "../../assets/android-res" +build_targets = ["aarch64-linux-android", "armv7-linux-androideabi"] + +[package.metadata.android.sdk] +target_sdk_version = 31 + +[package.metadata.android.application] +icon = "@mipmap/ic_launcher" +label = "Bevy Example" + diff --git a/examples/android/android.rs b/examples/android/src/lib.rs similarity index 100% rename from examples/android/android.rs rename to examples/android/src/lib.rs