Skip to content

Commit

Permalink
rename add_plugin_group to add_plugins (bevyengine#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
cart authored Nov 3, 2020
1 parent 9871e7e commit 66f2f76
Show file tree
Hide file tree
Showing 50 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_app/src/app_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@ impl AppBuilder {
self
}

pub fn add_plugin_group<T: PluginGroup>(&mut self, mut group: T) -> &mut Self {
pub fn add_plugins<T: PluginGroup>(&mut self, mut group: T) -> &mut Self {
let mut plugin_group_builder = PluginGroupBuilder::default();
group.build(&mut plugin_group_builder);
plugin_group_builder.finish(self);
self
}

pub fn add_plugin_group_with<T, F>(&mut self, mut group: T, func: F) -> &mut Self
pub fn add_plugins_with<T, F>(&mut self, mut group: T, func: F) -> &mut Self
where
T: PluginGroup,
F: FnOnce(&mut PluginGroupBuilder) -> &mut PluginGroupBuilder,
Expand Down
2 changes: 1 addition & 1 deletion examples/2d/sprite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy::prelude::*;

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/2d/sprite_sheet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy::prelude::*;

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.add_system(animate_sprite_system.system())
.run();
Expand Down
2 changes: 1 addition & 1 deletion examples/2d/texture_atlas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bevy::{asset::LoadState, prelude::*, sprite::TextureAtlasBuilder};
fn main() {
App::build()
.init_resource::<RpgSpriteHandles>()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.add_system(load_atlas.system())
.run();
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/3d_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bevy::prelude::*;
fn main() {
App::build()
.add_resource(Msaa { samples: 4 })
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/load_gltf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bevy::prelude::*;
fn main() {
App::build()
.add_resource(Msaa { samples: 4 })
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/msaa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use bevy::prelude::*;
fn main() {
App::build()
.add_resource(Msaa { samples: 4 })
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/parenting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy::prelude::*;
fn main() {
App::build()
.add_resource(Msaa { samples: 4 })
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.add_system(rotator_system.system())
.run();
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rand::{rngs::StdRng, Rng, SeedableRng};
/// NOTE: Bevy still has a number of optimizations to do in this area. Expect the performance here to go way up in the future
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_plugin(FrameTimeDiagnosticsPlugin::default())
.add_plugin(PrintDiagnosticsPlugin::default())
.add_startup_system(setup.system())
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bevy::prelude::*;
/// This example shows various ways to configure texture materials in 3D
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/z_sort_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use bevy::{
/// This example visualizes camera z-ordering by setting the material of rotating cubes to their distance from the camera
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.add_system(rotator_system.system())
.add_system(camera_order_color_system.system())
Expand Down
2 changes: 1 addition & 1 deletion examples/app/empty_defaults.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bevy::prelude::*;

fn main() {
App::build().add_plugin_group(DefaultPlugins).run();
App::build().add_plugins(DefaultPlugins).run();
}
4 changes: 2 additions & 2 deletions examples/app/headless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn main() {
// this app runs once
App::build()
.add_resource(ScheduleRunnerSettings::run_once())
.add_plugin_group(MinimalPlugins)
.add_plugins(MinimalPlugins)
.add_system(hello_world_system.system())
.run();

Expand All @@ -22,7 +22,7 @@ fn main() {
.add_resource(ScheduleRunnerSettings::run_loop(Duration::from_secs_f64(
1.0 / 60.0,
)))
.add_plugin_group(MinimalPlugins)
.add_plugins(MinimalPlugins)
.add_system(counter.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/app/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::time::Duration;
/// This example illustrates how to create a simple plugin that prints out a message.
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
// plugins are registered as part of the "app building" process
.add_plugin(PrintMessagePlugin {
wait_duration: Duration::from_secs(1),
Expand Down
6 changes: 3 additions & 3 deletions examples/app/plugin_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use bevy::{app::PluginGroupBuilder, prelude::*};
fn main() {
App::build()
// Two PluginGroups that are included with bevy are DefaultPlugins and MinimalPlugins
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
// Adding a plugin group adds all plugins in the group by default
.add_plugin_group(HelloWorldPlugins)
.add_plugins(HelloWorldPlugins)
// You can also modify a PluginGroup (such as disabling plugins) like this:
// .add_plugin_group_with(HelloWorldPlugins, |group| {
// .add_plugins_with(HelloWorldPlugins, |group| {
// group
// .disable::<PrintWorldPlugin>()
// .add_before::<PrintHelloPlugin, _>(bevy::diagnostic::PrintDiagnosticsPlugin::default())
Expand Down
4 changes: 2 additions & 2 deletions examples/app/return_after_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ fn main() {
return_from_run: true,
})
.add_resource(ClearColor(Color::rgb(0.2, 0.2, 0.8)))
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.run();
println!("Running another App.");
App::build()
.add_resource(WinitConfig {
return_from_run: true,
})
.add_resource(ClearColor(Color::rgb(0.2, 0.8, 0.2)))
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.run();
println!("Done.");
}
2 changes: 1 addition & 1 deletion examples/app/thread_pool_resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ use bevy::prelude::*;
fn main() {
App::build()
.add_resource(DefaultTaskPoolOptions::with_num_threads(4))
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.run();
}
2 changes: 1 addition & 1 deletion examples/asset/asset_loading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bevy::prelude::*;
fn main() {
App::build()
.add_resource(Msaa { samples: 4 })
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/asset/custom_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl AssetLoader for CustomAssetLoader {

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.init_resource::<State>()
.add_asset::<CustomAsset>()
.init_asset_loader::<CustomAssetLoader>()
Expand Down
2 changes: 1 addition & 1 deletion examples/asset/hot_asset_reloading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy::prelude::*;
/// This example illustrates hot reloading mesh changes.
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/audio/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bevy::prelude::*;
/// This example illustrates how to load and play an audio file
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/diagnostics/custom_diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use bevy::{
/// This example illustrates how to create a custom diagnostic
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
// The "print diagnostics" plugin is optional. It just visualizes our diagnostics in the console
.add_plugin(PrintDiagnosticsPlugin::default())
.add_startup_system(setup_diagnostic_system.system())
Expand Down
2 changes: 1 addition & 1 deletion examples/diagnostics/print_diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy::{

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
// Adds frame time diagnostics
.add_plugin(FrameTimeDiagnosticsPlugin::default())
// Adds a system that prints diagnostics to the console
Expand Down
2 changes: 1 addition & 1 deletion examples/ecs/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bevy::prelude::*;
/// and a system that prints a message whenever the event is received.
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_event::<MyEvent>()
.init_resource::<EventTriggerState>()
.add_system(event_trigger_system.system())
Expand Down
2 changes: 1 addition & 1 deletion examples/ecs/hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy::prelude::*;

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.add_system(rotate.system())
.run();
Expand Down
2 changes: 1 addition & 1 deletion examples/ecs/parallel_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn bounce_system(

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(spawn_system.system())
.add_system(move_system.system())
.add_system(bounce_system.system())
Expand Down
2 changes: 1 addition & 1 deletion examples/game/breakout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bevy::{
/// An implementation of the classic game "Breakout"
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_resource(Scoreboard { score: 0 })
.add_resource(ClearColor(Color::rgb(0.9, 0.9, 0.9)))
.add_startup_system(setup.system())
Expand Down
2 changes: 1 addition & 1 deletion examples/input/gamepad_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bevy_utils::HashSet;

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.init_resource::<GamepadLobby>()
.add_system_to_stage(stage::PRE_UPDATE, connection_system.system())
.add_system(gamepad_system.system())
Expand Down
2 changes: 1 addition & 1 deletion examples/input/gamepad_input_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bevy_input::gamepad::{GamepadEvent, GamepadEventType};

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_system(gamepad_events.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/input/keyboard_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy::{

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_system(keyboard_input_system.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/input/keyboard_input_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy::{input::keyboard::KeyboardInput, prelude::*};

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_system(print_keyboard_event_system.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/input/mouse_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy::prelude::*;

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_system(mouse_click_system.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/input/mouse_input_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use bevy::{

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_system(print_mouse_events_system.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/input/touch_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy::{input::touch::*, prelude::*};

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_system(touch_system.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/input/touch_input_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy::{input::touch::*, prelude::*};

fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_system(touch_event_system.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ios/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern "C" fn main_rs() {
..Default::default()
})
.add_resource(Msaa { samples: 4 })
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/scene/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
/// familiar with "reflection" in other languages, Properties are very similar to that concept.
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
// If you need to deserialize custom property types, register them like this:
.register_property::<Test>()
.register_property::<Nested>()
Expand Down
2 changes: 1 addition & 1 deletion examples/scene/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bevy::{prelude::*, type_registry::TypeRegistry};
/// This example illustrates loading and saving scenes from files
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
// Registering components informs Bevy that they exist. This allows them to be used when loading scenes
// This step is only required if you want to load your components from scene files.
// Unregistered components can still be used in your code, but they will be ignored during scene save/load.
Expand Down
2 changes: 1 addition & 1 deletion examples/shader/mesh_custom_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use bevy::{
/// This example illustrates how to add a custom attribute to a mesh and use it in a custom shader.
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_asset::<MyMaterialWithVertexColorSupport>()
.add_startup_system(setup.system())
.run();
Expand Down
2 changes: 1 addition & 1 deletion examples/shader/shader_custom_material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use bevy::{
/// This example illustrates how to create a custom material asset and a shader that uses that material
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_asset::<MyMaterial>()
.add_startup_system(setup.system())
.run();
Expand Down
2 changes: 1 addition & 1 deletion examples/shader/shader_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use bevy::{
/// In Bevy, "shader defs" are a way to selectively enable parts of a shader based on values set in a component or asset.
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_plugins(DefaultPlugins)
.add_asset::<MyMaterial>()
.add_startup_system(setup.system())
.add_system_to_stage(
Expand Down
Loading

0 comments on commit 66f2f76

Please sign in to comment.