From b3bf1132ddcebb3e2a24810ba5da8b88c53f2d05 Mon Sep 17 00:00:00 2001 From: Elabajaba Date: Thu, 25 Jan 2024 00:46:12 -0500 Subject: [PATCH 1/4] fix cyclic dev-dependency --- crates/bevy_input/Cargo.toml | 3 --- crates/bevy_input/src/common_conditions.rs | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/bevy_input/Cargo.toml b/crates/bevy_input/Cargo.toml index 28a8c57ee8009..d5d35d2edd739 100644 --- a/crates/bevy_input/Cargo.toml +++ b/crates/bevy_input/Cargo.toml @@ -27,8 +27,5 @@ serde = { version = "1", features = ["derive"], optional = true } thiserror = "1.0" smol_str = "0.2" -[dev-dependencies] -bevy = { path = "../../", version = "0.12.0" } - [lints] workspace = true diff --git a/crates/bevy_input/src/common_conditions.rs b/crates/bevy_input/src/common_conditions.rs index 06e0b96375f4f..6289a24ed867e 100644 --- a/crates/bevy_input/src/common_conditions.rs +++ b/crates/bevy_input/src/common_conditions.rs @@ -101,7 +101,8 @@ where #[cfg(test)] mod tests { use super::*; - use bevy::prelude::{IntoSystemConfigs, KeyCode, Schedule}; + use crate::prelude::KeyCode; + use bevy_ecs::schedule::{IntoSystemConfigs, Schedule}; fn test_system() {} From e218b109d5e5141d6b03e613f7f8610f8d4c2209 Mon Sep 17 00:00:00 2001 From: Elabajaba Date: Thu, 25 Jan 2024 01:15:15 -0500 Subject: [PATCH 2/4] bevy_reflect's "smol_str" feature is required for this crate to actually compile --- crates/bevy_input/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_input/Cargo.toml b/crates/bevy_input/Cargo.toml index d5d35d2edd739..69ff94eaa6b3e 100644 --- a/crates/bevy_input/Cargo.toml +++ b/crates/bevy_input/Cargo.toml @@ -19,7 +19,7 @@ bevy_ecs = { path = "../bevy_ecs", version = "0.12.0" } bevy_math = { path = "../bevy_math", version = "0.12.0" } bevy_utils = { path = "../bevy_utils", version = "0.12.0" } bevy_reflect = { path = "../bevy_reflect", version = "0.12.0", features = [ - "glam", + "glam", "smol_str", ] } # other From c8d5c8093e16ebce890f67e32a9e47155b68465a Mon Sep 17 00:00:00 2001 From: Elabajaba Date: Thu, 25 Jan 2024 01:31:24 -0500 Subject: [PATCH 3/4] fix doctests --- crates/bevy_input/src/common_conditions.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/bevy_input/src/common_conditions.rs b/crates/bevy_input/src/common_conditions.rs index 6289a24ed867e..4a7e4dd7bed9f 100644 --- a/crates/bevy_input/src/common_conditions.rs +++ b/crates/bevy_input/src/common_conditions.rs @@ -5,8 +5,9 @@ use std::hash::Hash; /// Stateful run condition that can be toggled via a input press using [`ButtonInput::just_pressed`]. /// /// ```no_run -/// use bevy::prelude::*; -/// use bevy::input::common_conditions::input_toggle_active; +/// # use bevy_app::{App, NoopPluginGroup as DefaultPlugins, Update}; +/// # use bevy_ecs::prelude::IntoSystemConfigs; +/// # use bevy_input::{common_conditions::input_toggle_active, prelude::KeyCode}; /// /// fn main() { /// App::new() @@ -23,8 +24,9 @@ use std::hash::Hash; /// If you want other systems to be able to access whether the toggled state is active, /// you should use a custom resource or a state for that: /// ```no_run -/// use bevy::prelude::*; -/// use bevy::input::common_conditions::input_just_pressed; +/// # use bevy_app::{App, NoopPluginGroup as DefaultPlugins, Update}; +/// # use bevy_ecs::prelude::{IntoSystemConfigs, Res, ResMut, Resource}; +/// # use bevy_input::{common_conditions::input_just_pressed, prelude::KeyCode}; /// /// #[derive(Resource, Default)] /// struct Paused(bool); @@ -72,8 +74,9 @@ where /// Run condition that is active if [`ButtonInput::just_pressed`] is true for the given input. /// /// ```no_run -/// use bevy::prelude::*; -/// use bevy::input::common_conditions::input_just_pressed; +/// # use bevy_app::{App, NoopPluginGroup as DefaultPlugins, Update}; +/// # use bevy_ecs::prelude::IntoSystemConfigs; +/// # use bevy_input::{common_conditions::input_just_pressed, prelude::KeyCode}; /// fn main() { /// App::new() /// .add_plugins(DefaultPlugins) From 8b312f00fd5c4546f0d05078a86af3bf6eb0b466 Mon Sep 17 00:00:00 2001 From: Elabajaba Date: Thu, 25 Jan 2024 01:39:08 -0500 Subject: [PATCH 4/4] toml formatting --- crates/bevy_input/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bevy_input/Cargo.toml b/crates/bevy_input/Cargo.toml index 69ff94eaa6b3e..b895d634bd694 100644 --- a/crates/bevy_input/Cargo.toml +++ b/crates/bevy_input/Cargo.toml @@ -19,7 +19,8 @@ bevy_ecs = { path = "../bevy_ecs", version = "0.12.0" } bevy_math = { path = "../bevy_math", version = "0.12.0" } bevy_utils = { path = "../bevy_utils", version = "0.12.0" } bevy_reflect = { path = "../bevy_reflect", version = "0.12.0", features = [ - "glam", "smol_str", + "glam", + "smol_str", ] } # other