diff --git a/Cargo.toml b/Cargo.toml index cd288d55..becebe8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ crossbow-android = { path = "platform/android", version = "0.2.3", optional = tr crossbow-ios = { path = "platform/ios", version = "0.2.3", optional = true } [patch.crates-io] +bevy = { git = "https://github.com/dodorare/bevy", rev = "732fc8c585ebd3a622153771a8c51ace93024a04" } miniquad = { git = "https://github.com/not-fl3/miniquad", rev = "d67ffe6950cf73df307e2d23aaa4726f14399985" } [features] diff --git a/docs/src/tutorials/subxt-with-bevy.md b/docs/src/tutorials/subxt-with-bevy.md index 4bb0ab8d..5c2a8e34 100644 --- a/docs/src/tutorials/subxt-with-bevy.md +++ b/docs/src/tutorials/subxt-with-bevy.md @@ -7,7 +7,7 @@ ```sh [dependencies] substrate-subxt = "0.21" -bevy = "0.8.0" +bevy = "0.8.1" ``` ## Bevy explorer example diff --git a/examples/bevy-2d/Cargo.toml b/examples/bevy-2d/Cargo.toml index c9687bf8..63b0020c 100644 --- a/examples/bevy-2d/Cargo.toml +++ b/examples/bevy-2d/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" crossbow = { version = "0.2.3", path = "../../" } log = "0.4" anyhow = "1.0" -bevy = { version = "0.8.0", default-features = false, features = ["bevy_winit", "render", "bevy_asset"] } +bevy = { version = "0.8.1", default-features = false, features = ["bevy_winit", "render", "bevy_asset"] } [package.metadata] app_name = "Bevy 2D" diff --git a/examples/bevy-explorer/Cargo.toml b/examples/bevy-explorer/Cargo.toml index 32c9ce15..3d4f40e1 100644 --- a/examples/bevy-explorer/Cargo.toml +++ b/examples/bevy-explorer/Cargo.toml @@ -10,7 +10,7 @@ log = "0.4" anyhow = "1.0" subxt = "0.21" tokio = { version = "1.17", features = ["sync", "macros", "rt-multi-thread"] } -bevy = { version = "0.8.0", default-features = false, features = ["bevy_winit", "render", "bevy_asset"] } +bevy = { version = "0.8.1", default-features = false, features = ["bevy_winit", "render", "bevy_asset"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } jsonrpsee = { version = "0.10.1", features = ["async-client", "client-ws-transport"] } @@ -22,6 +22,20 @@ assets = ["../../assets"] release_build_targets = ["aarch64-linux-android"] resources = ["../../assets/res/android"] +[[package.metadata.android.plugins_local_projects]] +include = ":crossbow" +dont_implement = true +project_dir = "../../platform/android/java" +[[package.metadata.android.plugins_local_projects]] +include = ":crossbow:lib" +[package.metadata.android.manifest] +package = "com.crossbow.example.permissions" +[[package.metadata.android.manifest.uses_permission]] +name = "android.permission.INTERNET" +[package.metadata.android.manifest.uses_sdk] +min_sdk_version = 19 +target_sdk_version = 31 + [package.metadata.apple] release_build_targets = ["aarch64-apple-ios", "x86_64-apple-ios"] resources = ["../../assets/res/apple"] diff --git a/examples/bevy-explorer/res/metadata.scale b/examples/bevy-explorer/res/metadata.scale deleted file mode 100644 index 73ed03cf..00000000 Binary files a/examples/bevy-explorer/res/metadata.scale and /dev/null differ diff --git a/examples/bevy-explorer/res/polkadot_metadata.scale b/examples/bevy-explorer/res/polkadot_metadata.scale new file mode 100644 index 00000000..f29d1024 Binary files /dev/null and b/examples/bevy-explorer/res/polkadot_metadata.scale differ diff --git a/examples/bevy-explorer/src/explorer.rs b/examples/bevy-explorer/src/explorer.rs index dc3a7a32..3490869b 100644 --- a/examples/bevy-explorer/src/explorer.rs +++ b/examples/bevy-explorer/src/explorer.rs @@ -6,7 +6,7 @@ use subxt::{ }; use tokio::sync::mpsc; -#[subxt::subxt(runtime_metadata_path = "res/metadata.scale")] +#[subxt::subxt(runtime_metadata_path = "res/polkadot_metadata.scale")] pub mod bevy_explorer {} #[cfg(not(target_os = "android"))] @@ -28,14 +28,16 @@ impl ExplorerStateChannel { } } -pub fn explorer_startup(task_pool: Res, channel: Res) { +pub fn explorer_startup(channel: Res) { + let thread_pool = AsyncComputeTaskPool::get(); let tx = channel.tx.clone(); + #[cfg(target_os = "android")] let certificate = CertificateStore::WebPki; #[cfg(not(target_os = "android"))] let certificate = CertificateStore::Native; - task_pool + thread_pool .spawn(async move { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { @@ -77,7 +79,7 @@ pub fn explorer_startup(task_pool: Res, channel: Res