diff --git a/crates/bevy_app/Cargo.toml b/crates/bevy_app/Cargo.toml index 2dd25147e42f9..a60532fbb0a56 100644 --- a/crates/bevy_app/Cargo.toml +++ b/crates/bevy_app/Cargo.toml @@ -31,6 +31,3 @@ ron = { version = "0.7.0", optional = true } wasm-bindgen = { version = "0.2" } web-sys = { version = "0.3", features = [ "Window" ] } -[dev-dependencies] -# bevy -bevy_log = { path = "../bevy_log", version = "0.8.0-dev" } diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index cdf1984c8b01e..4d72c15e7d4ed 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -761,6 +761,16 @@ impl App { /// ``` /// # use bevy_app::prelude::*; /// # + /// # // Dummies created to avoid using `bevy_log`, + /// # // which pulls in too many dependencies and breaks rust-analyzer + /// # pub mod bevy_log { + /// # use bevy_app::prelude::*; + /// # #[derive(Default)] + /// # pub struct LogPlugin; + /// # impl Plugin for LogPlugin{ + /// # fn build(&self, app: &mut App) {} + /// # } + /// # } /// App::new().add_plugin(bevy_log::LogPlugin::default()); /// ``` pub fn add_plugin(&mut self, plugin: T) -> &mut Self @@ -784,13 +794,7 @@ impl App { /// /// ## Examples /// ``` - /// # use bevy_app::{prelude::*, PluginGroupBuilder}; - /// # - /// # // Dummy created to avoid using bevy_internal, which pulls in to many dependencies. - /// # struct MinimalPlugins; - /// # impl PluginGroup for MinimalPlugins { - /// # fn build(&mut self, group: &mut PluginGroupBuilder){;} - /// # } + /// # use bevy_app::{prelude::*, PluginGroupBuilder, NoopPluginGroup as MinimalPlugins}; /// # /// App::new() /// .add_plugins(MinimalPlugins); @@ -814,7 +818,16 @@ impl App { /// ``` /// # use bevy_app::{prelude::*, PluginGroupBuilder}; /// # - /// # // Dummies created to avoid using bevy_internal which pulls in too many dependencies. + /// # // Dummies created to avoid using `bevy_internal` and `bevy_log`, + /// # // which pulls in too many dependencies and breaks rust-analyzer + /// # pub mod bevy_log { + /// # use bevy_app::prelude::*; + /// # #[derive(Default)] + /// # pub struct LogPlugin; + /// # impl Plugin for LogPlugin{ + /// # fn build(&self, app: &mut App) {} + /// # } + /// # } /// # struct DefaultPlugins; /// # impl PluginGroup for DefaultPlugins { /// # fn build(&mut self, group: &mut PluginGroupBuilder){ diff --git a/crates/bevy_app/src/plugin_group.rs b/crates/bevy_app/src/plugin_group.rs index d707634fd8503..bc7f75d7d8113 100644 --- a/crates/bevy_app/src/plugin_group.rs +++ b/crates/bevy_app/src/plugin_group.rs @@ -139,6 +139,22 @@ impl PluginGroupBuilder { } } +/// A plugin group which doesn't do anything. Useful for examples: +/// ```rust +/// # use bevy_app::prelude::*; +/// use bevy_app::NoopPluginGroup as MinimalPlugins; +/// +/// fn main(){ +/// App::new().add_plugins(MinimalPlugins).run(); +/// } +/// ``` +#[doc(hidden)] +pub struct NoopPluginGroup; + +impl PluginGroup for NoopPluginGroup { + fn build(&mut self, _: &mut PluginGroupBuilder) {} +} + #[cfg(test)] mod tests { use super::PluginGroupBuilder; diff --git a/crates/bevy_audio/Cargo.toml b/crates/bevy_audio/Cargo.toml index 3e7603f82c700..9b04cc4bf826d 100644 --- a/crates/bevy_audio/Cargo.toml +++ b/crates/bevy_audio/Cargo.toml @@ -24,9 +24,6 @@ parking_lot = "0.11.0" [target.'cfg(target_arch = "wasm32")'.dependencies] rodio = { version = "0.15", default-features = false, features = ["wasm-bindgen"] } -[dev-dependencies] -# bevy -bevy_internal = { path = "../bevy_internal", version = "0.8.0-dev" } [features] mp3 = ["rodio/mp3"] diff --git a/crates/bevy_audio/src/lib.rs b/crates/bevy_audio/src/lib.rs index e3663e1adf41e..c4f2390ebf4eb 100644 --- a/crates/bevy_audio/src/lib.rs +++ b/crates/bevy_audio/src/lib.rs @@ -1,17 +1,15 @@ //! Audio support for the game engine Bevy //! -//! ``` +//! ```no_run //! # use bevy_ecs::{system::Res, event::EventWriter}; //! # use bevy_audio::{Audio, AudioPlugin}; //! # use bevy_asset::{AssetPlugin, AssetServer}; -//! # use bevy_app::{App, AppExit}; -//! # use bevy_internal::MinimalPlugins; +//! # use bevy_app::{App, AppExit, NoopPluginGroup as MinimalPlugins}; //! fn main() { //! App::new() //! .add_plugins(MinimalPlugins) //! .add_plugin(AssetPlugin) //! .add_plugin(AudioPlugin) -//! # .add_system(stop) //! .add_startup_system(play_background_audio) //! .run(); //! } @@ -19,10 +17,6 @@ //! fn play_background_audio(asset_server: Res, audio: Res