Skip to content

Commit e8bed49

Browse files
committed
remove bevy_bindings as a whole and only use fine-grained features
1 parent 08b4a7a commit e8bed49

File tree

6 files changed

+32
-34
lines changed

6 files changed

+32
-34
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ features = ["lua54", "rhai"]
2323
[features]
2424
default = [
2525
"core_functions",
26-
"bevy_bindings",
2726
"bevy_core_bindings",
2827
"bevy_ecs_bindings",
2928
"bevy_hierarchy_bindings",
@@ -49,8 +48,6 @@ luau = ["bevy_mod_scripting_lua/luau", "lua"]
4948

5049
# bindings
5150
core_functions = ["bevy_mod_scripting_functions/core_functions"]
52-
bevy_bindings = ["bevy_mod_scripting_functions/bevy_bindings"]
53-
5451
bevy_core_bindings = ["bevy_mod_scripting_functions/bevy_core"]
5552
bevy_ecs_bindings = ["bevy_mod_scripting_functions/bevy_ecs"]
5653
bevy_hierarchy_bindings = ["bevy_mod_scripting_functions/bevy_hierarchy"]

crates/bevy_mod_scripting_functions/Cargo.toml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@ categories = ["game-development"]
1212
readme = "readme.md"
1313

1414
[features]
15-
bevy_core = ["bevy_bindings"]
16-
bevy_ecs = ["bevy_bindings"]
17-
bevy_hierarchy = ["bevy_bindings"]
18-
bevy_input = ["bevy_bindings"]
19-
bevy_math = ["bevy_bindings"]
20-
bevy_reflect = ["bevy_bindings"]
21-
bevy_time = ["bevy_bindings"]
22-
bevy_transform = ["bevy_bindings"]
15+
bevy_core = []
16+
bevy_ecs = []
17+
bevy_hierarchy = []
18+
bevy_input = []
19+
bevy_math = []
20+
bevy_reflect = []
21+
bevy_time = []
22+
bevy_transform = []
2323

2424
core_functions = []
25-
bevy_bindings = []
2625
lua_bindings = ["bevy_mod_scripting_lua"]
2726
rhai_bindings = ["bevy_mod_scripting_rhai"]
2827

crates/bevy_mod_scripting_functions/src/core.rs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,22 @@ use reflection_extensions::{PartialReflectExt, TypeIdExtensions};
3232

3333
#[allow(unused_variables, reason = "feature flags")]
3434
pub fn register_bevy_bindings(app: &mut App) {
35-
#[cfg(feature = "bevy_bindings")]
36-
{
37-
#[cfg(feature = "bevy_core")]
38-
app.add_plugins(crate::bevy_bindings::bevy_core::BevyCoreScriptingPlugin);
39-
#[cfg(feature = "bevy_ecs")]
40-
app.add_plugins(crate::bevy_bindings::bevy_ecs::BevyEcsScriptingPlugin);
41-
#[cfg(feature = "bevy_hierarchy")]
42-
app.add_plugins(crate::bevy_bindings::bevy_hierarchy::BevyHierarchyScriptingPlugin);
43-
#[cfg(feature = "bevy_input")]
44-
app.add_plugins(crate::bevy_bindings::bevy_input::BevyInputScriptingPlugin);
45-
#[cfg(feature = "bevy_math")]
46-
app.add_plugins(crate::bevy_bindings::bevy_math::BevyMathScriptingPlugin);
47-
#[cfg(feature = "bevy_reflect")]
48-
app.add_plugins(crate::bevy_bindings::bevy_reflect::BevyReflectScriptingPlugin);
49-
#[cfg(feature = "bevy_time")]
50-
app.add_plugins(crate::bevy_bindings::bevy_time::BevyTimeScriptingPlugin);
51-
#[cfg(feature = "bevy_transform")]
52-
app.add_plugins(crate::bevy_bindings::bevy_transform::BevyTransformScriptingPlugin);
53-
}
35+
#[cfg(feature = "bevy_core")]
36+
app.add_plugins(crate::bevy_bindings::bevy_core::BevyCoreScriptingPlugin);
37+
#[cfg(feature = "bevy_ecs")]
38+
app.add_plugins(crate::bevy_bindings::bevy_ecs::BevyEcsScriptingPlugin);
39+
#[cfg(feature = "bevy_hierarchy")]
40+
app.add_plugins(crate::bevy_bindings::bevy_hierarchy::BevyHierarchyScriptingPlugin);
41+
#[cfg(feature = "bevy_input")]
42+
app.add_plugins(crate::bevy_bindings::bevy_input::BevyInputScriptingPlugin);
43+
#[cfg(feature = "bevy_math")]
44+
app.add_plugins(crate::bevy_bindings::bevy_math::BevyMathScriptingPlugin);
45+
#[cfg(feature = "bevy_reflect")]
46+
app.add_plugins(crate::bevy_bindings::bevy_reflect::BevyReflectScriptingPlugin);
47+
#[cfg(feature = "bevy_time")]
48+
app.add_plugins(crate::bevy_bindings::bevy_time::BevyTimeScriptingPlugin);
49+
#[cfg(feature = "bevy_transform")]
50+
app.add_plugins(crate::bevy_bindings::bevy_transform::BevyTransformScriptingPlugin);
5451
}
5552

5653
#[script_bindings(

crates/bevy_mod_scripting_functions/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![allow(missing_docs)]
22

33
use ::bevy::prelude::*;
4-
#[cfg(feature = "bevy_bindings")]
54
pub mod bevy_bindings;
65
pub mod core;
76
pub use core::*;

crates/testing_crates/script_integration_test_harness/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ bevy = { workspace = true }
1414
test_utils = { workspace = true }
1515
bevy_mod_scripting_core = { workspace = true }
1616
bevy_mod_scripting_functions = { workspace = true, features = [
17-
"bevy_bindings",
1817
"core_functions",
1918
] }
2019
regex = { version = "1.11" }

docs/src/Summary/installation.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ By default all of the useful features are enabled, but you may disable them if y
5050
| Feature | Description |
5151
| ---- | ---- |
5252
| core_functions | If enabled, will enable all core functions, i.e. bevy integrations which let you interact with Bevy via reflection |
53-
| bevy_bindings | If enabled, populates the function registry with additiona automatically generated bevy bindings. This includes functions on `glam` and `bevy::ecs` types. These are useful but will slow down compilation considerably. |
53+
| bevy_core_bindings | Enables bindings for the `bevy_core` module |
54+
| bevy_ecs_bindings | Enables bindings for the `bevy_ecs` module |
55+
| bevy_hierarchy_bindings | Enables bindings for the `bevy_hierarchy` module |
56+
| bevy_input_bindings | Enables bindings for the `bevy_input` module |
57+
| bevy_math_bindings | Enables bindings for the `bevy_math` module |
58+
| bevy_reflect_bindings | Enables bindings for the `bevy_reflect` module |
59+
| bevy_time_bindings | Enables bindings for the `bevy_time` module |
60+
| bevy_transform_bindings | Enables bindings for the `bevy_transform` module |
5461
| mlua_async | Enables `mlua/async`|
5562
| mlua_serialize | Enables `mlua/serialize` |
5663
| mlua_macros | Enables `mlua/macros` |

0 commit comments

Comments
 (0)