more optional features

This commit is contained in:
Carter Anderson 2020-07-31 12:26:36 -07:00
parent ccf81edd8f
commit 471639841b
4 changed files with 23 additions and 11 deletions

View file

@ -5,7 +5,7 @@ authors = ["Carter Anderson <mcanders1@gmail.com>"]
edition = "2018" edition = "2018"
[features] [features]
default = ["bevy_wgpu", "bevy_winit"] default = ["bevy_audio", "bevy_gltf", "bevy_wgpu", "bevy_winit"]
profiler = ["bevy_ecs/profiler", "bevy_diagnostic/profiler"] profiler = ["bevy_ecs/profiler", "bevy_diagnostic/profiler"]
[workspace] [workspace]
@ -17,14 +17,12 @@ members = [
[dependencies] [dependencies]
# bevy # bevy
bevy_audio = { path = "crates/bevy_audio" }
bevy_app = { path = "crates/bevy_app" } bevy_app = { path = "crates/bevy_app" }
bevy_asset = { path = "crates/bevy_asset" } bevy_asset = { path = "crates/bevy_asset" }
bevy_type_registry = { path = "crates/bevy_type_registry" } bevy_type_registry = { path = "crates/bevy_type_registry" }
bevy_core = { path = "crates/bevy_core" } bevy_core = { path = "crates/bevy_core" }
bevy_diagnostic = { path = "crates/bevy_diagnostic" } bevy_diagnostic = { path = "crates/bevy_diagnostic" }
bevy_ecs = { path = "crates/bevy_ecs" } bevy_ecs = { path = "crates/bevy_ecs" }
bevy_gltf = { path = "crates/bevy_gltf" }
bevy_input = { path = "crates/bevy_input" } bevy_input = { path = "crates/bevy_input" }
bevy_math = { path = "crates/bevy_math" } bevy_math = { path = "crates/bevy_math" }
bevy_pbr = { path = "crates/bevy_pbr" } bevy_pbr = { path = "crates/bevy_pbr" }
@ -36,6 +34,9 @@ bevy_transform = { path = "crates/bevy_transform" }
bevy_text = { path = "crates/bevy_text" } bevy_text = { path = "crates/bevy_text" }
bevy_ui = { path = "crates/bevy_ui" } bevy_ui = { path = "crates/bevy_ui" }
bevy_window = { path = "crates/bevy_window" } bevy_window = { path = "crates/bevy_window" }
bevy_audio = { path = "crates/bevy_audio", optional = true }
bevy_gltf = { path = "crates/bevy_gltf", optional = true }
bevy_wgpu = { path = "crates/bevy_wgpu", optional = true } bevy_wgpu = { path = "crates/bevy_wgpu", optional = true }
bevy_winit = { path = "crates/bevy_winit", optional = true } bevy_winit = { path = "crates/bevy_winit", optional = true }

View file

@ -18,14 +18,16 @@ impl AddDefaultPlugins for AppBuilder {
self.add_plugin(bevy_sprite::SpritePlugin::default()); self.add_plugin(bevy_sprite::SpritePlugin::default());
self.add_plugin(bevy_pbr::PbrPlugin::default()); self.add_plugin(bevy_pbr::PbrPlugin::default());
self.add_plugin(bevy_ui::UiPlugin::default()); self.add_plugin(bevy_ui::UiPlugin::default());
self.add_plugin(bevy_gltf::GltfPlugin::default());
self.add_plugin(bevy_text::TextPlugin::default()); self.add_plugin(bevy_text::TextPlugin::default());
#[cfg(feature = "bevy_audio")]
self.add_plugin(bevy_audio::AudioPlugin::default()); self.add_plugin(bevy_audio::AudioPlugin::default());
#[cfg(feature = "bevy_gltf")]
self.add_plugin(bevy_gltf::GltfPlugin::default());
#[cfg(feature = "bevy_winit")] #[cfg(feature = "bevy_winit")]
self.add_plugin(bevy_winit::WinitPlugin::default()); self.add_plugin(bevy_winit::WinitPlugin::default());
#[cfg(not(feature = "bevy_winit"))]
self.add_plugin(bevy_app::schedule_runner::ScheduleRunnerPlugin::default());
#[cfg(feature = "bevy_wgpu")] #[cfg(feature = "bevy_wgpu")]
self.add_plugin(bevy_wgpu::WgpuPlugin::default()); self.add_plugin(bevy_wgpu::WgpuPlugin::default());

View file

@ -43,11 +43,9 @@ pub mod prelude;
pub use add_default_plugins::*; pub use add_default_plugins::*;
pub use bevy_app as app; pub use bevy_app as app;
pub use bevy_asset as asset; pub use bevy_asset as asset;
pub use bevy_audio as audio;
pub use bevy_core as core; pub use bevy_core as core;
pub use bevy_diagnostic as diagnostic; pub use bevy_diagnostic as diagnostic;
pub use bevy_ecs as ecs; pub use bevy_ecs as ecs;
pub use bevy_gltf as gltf;
pub use bevy_input as input; pub use bevy_input as input;
pub use bevy_math as math; pub use bevy_math as math;
pub use bevy_pbr as pbr; pub use bevy_pbr as pbr;
@ -59,8 +57,16 @@ pub use bevy_text as text;
pub use bevy_transform as transform; pub use bevy_transform as transform;
pub use bevy_type_registry as type_registry; pub use bevy_type_registry as type_registry;
pub use bevy_ui as ui; pub use bevy_ui as ui;
#[cfg(feature = "bevy_wgpu")]
pub use bevy_wgpu as wgpu;
pub use bevy_window as window; pub use bevy_window as window;
#[cfg(feature = "bevy_audio")]
pub use bevy_audio as audio;
#[cfg(feature = "bevy_gltf")]
pub use bevy_gltf as gltf;
#[cfg(feature = "bevy_winit")] #[cfg(feature = "bevy_winit")]
pub use bevy_winit as winit; pub use bevy_winit as winit;
#[cfg(feature = "bevy_wgpu")]
pub use bevy_wgpu as wgpu;

View file

@ -1,6 +1,9 @@
pub use crate::{ pub use crate::{
app::prelude::*, asset::prelude::*, audio::prelude::*, core::prelude::*, ecs::prelude::*, app::prelude::*, asset::prelude::*, core::prelude::*, ecs::prelude::*,
input::prelude::*, math::prelude::*, pbr::prelude::*, property::prelude::*, render::prelude::*, input::prelude::*, math::prelude::*, pbr::prelude::*, property::prelude::*, render::prelude::*,
scene::prelude::*, sprite::prelude::*, text::prelude::*, transform::prelude::*, scene::prelude::*, sprite::prelude::*, text::prelude::*, transform::prelude::*,
type_registry::RegisterType, ui::prelude::*, window::prelude::*, AddDefaultPlugins, type_registry::RegisterType, ui::prelude::*, window::prelude::*, AddDefaultPlugins,
}; };
#[cfg(feature = "bevy_audio")]
pub use crate::audio::prelude::*;