Skip to content

Commit 26d7678

Browse files
committed
chore: First pass.
1 parent c497b43 commit 26d7678

File tree

12 files changed

+40
-32
lines changed

12 files changed

+40
-32
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ bevy_script_api = { path = "crates/bevy_script_api", version = "0.6.0", optional
7070

7171

7272
[workspace.dependencies]
73-
bevy = { version = "=0.13.1", default-features = false }
73+
bevy = { version = "0.14", default-features = false }
7474
bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.6.0" }
7575
bevy_mod_scripting_common = { path = "crates/bevy_mod_scripting_common", version = "0.6.0" }
7676

7777
[dev-dependencies]
7878
bevy = { workspace = true, default-features = true }
7979
clap = { version = "4.1", features = ["derive"] }
8080
rand = "0.8.5"
81-
bevy_console = "0.11.1"
81+
# bevy_console = "0.11.1"
8282
rhai-rand = "0.1"
8383

8484
[workspace]
@@ -118,7 +118,7 @@ required-features = [
118118
"lua54",
119119
"lua_script_api",
120120
"bevy/file_watcher",
121-
"bevy/multi-threaded",
121+
"bevy/multi_threaded",
122122
]
123123

124124
[[example]]
@@ -128,7 +128,7 @@ required-features = [
128128
"rhai",
129129
"rhai_script_api",
130130
"bevy/file_watcher",
131-
"bevy/multi-threaded",
131+
"bevy/multi_threaded",
132132
]
133133

134134
[[example]]
@@ -143,7 +143,7 @@ required-features = [
143143
"lua54",
144144
"lua_script_api",
145145
"bevy/file_watcher",
146-
"bevy/multi-threaded",
146+
"bevy/multi_threaded",
147147
]
148148

149149
[[example]]
@@ -153,7 +153,7 @@ required-features = [
153153
"rhai",
154154
"rhai_script_api",
155155
"bevy/file_watcher",
156-
"bevy/multi-threaded",
156+
"bevy/multi_threaded",
157157
]
158158

159159
[[example]]

check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ CURRENT_DIR=$(basename "$PWD")
66
if [[ "$CURRENT_DIR" == "bevy_api_gen" ]]; then
77
cargo clippy --all-targets --message-format=json
88
else
9-
cargo clippy --workspace --all-targets --message-format=json --features="lua54 lua_script_api rhai rhai_script_api teal rune bevy/file_watcher bevy/multi-threaded"
10-
fi
9+
cargo clippy --workspace --all-targets --message-format=json --features="lua54 lua_script_api rhai rhai_script_api teal rune bevy/file_watcher bevy/multi_threaded"
10+
fi

crates/bevy_api_gen/Cargo.bootstrap.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ edition = "2021"
66

77
[dependencies]
88
mlua = { version = "0.9.2", features = ["lua54", "vendored", "send", "macros"] }
9-
bevy_reflect = { version = "0.13.1", features = ["bevy", "bevy_math"] }
9+
bevy_reflect = { version = "0.14", features = ["bevy", "bevy_math"] }
1010

1111
[workspace]

crates/bevy_mod_scripting_core/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl GenDocumentation for App {
5757
#[cfg(any(debug_assertions, feature = "doc_always"))]
5858
{
5959
info!("Generating documentation");
60-
let w = &mut self.world;
60+
let w = &mut self.world_mut();
6161
let providers: &APIProviders<T> = w.resource();
6262
if let Err(e) = providers.gen_all() {
6363
error!("{}", e);
@@ -137,7 +137,7 @@ impl AddScriptApiProvider for App {
137137
>,
138138
) -> &mut Self {
139139
provider.register_with_app(self);
140-
let w = &mut self.world;
140+
let w = &mut self.world_mut();
141141
let providers: &mut APIProviders<T> = &mut w.resource_mut();
142142
providers.providers.push(provider);
143143
self

crates/bevy_script_api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bevy = { workspace = true, default-features = false, features = [
2727
"bevy_text",
2828
"bevy_sprite",
2929
"file_watcher",
30-
"multi-threaded",
30+
"multi_threaded",
3131
] }
3232
bevy_mod_scripting_core = { workspace = true }
3333
parking_lot = "0.12.1"

crates/bevy_script_api/src/common/bevy/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use bevy::{
44
ecs::{
55
component::ComponentId,
66
query::QueryBuilder,
7-
system::Command,
8-
world::{EntityRef, World},
7+
world::{EntityRef, World, Command},
98
},
109
prelude::{
1110
AppTypeRegistry, BuildWorldChildren, Children, DespawnChildrenRecursive, DespawnRecursive,

crates/bevy_script_api/src/lua/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl RegisterForeignLuaType for App {
4242
&mut self,
4343
) -> &mut Self {
4444
{
45-
let registry = self.world.resource_mut::<AppTypeRegistry>();
45+
let registry = self.world_mut().resource_mut::<AppTypeRegistry>();
4646
let mut registry = registry.write();
4747

4848
let user_data = <ReflectLuaProxyable as FromType<T>>::from_type();

crates/bevy_script_api/src/providers/bevy_input.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ struct TouchPhase {}
713713
#[derive(bevy_mod_scripting_lua_derive::LuaProxy)]
714714
#[proxy(
715715
derive(clone),
716-
remote = "bevy::input::touchpad::TouchpadMagnify",
716+
remote = "bevy::input::touch::TouchpadMagnify",
717717
functions[r#"
718718
719719
#[lua(
@@ -722,13 +722,13 @@ struct TouchPhase {}
722722
composite = "eq",
723723
metamethod = "Eq",
724724
)]
725-
fn eq(&self, #[proxy] other: &touchpad::TouchpadMagnify) -> bool;
725+
fn eq(&self, #[proxy] other: &touch::TouchpadMagnify) -> bool;
726726
727727
"#,
728728
r#"
729729
730730
#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
731-
fn clone(&self) -> bevy::input::touchpad::TouchpadMagnify;
731+
fn clone(&self) -> bevy::input::touch::TouchpadMagnify;
732732
733733
"#,
734734
r#"
@@ -742,7 +742,7 @@ struct TouchpadMagnify(f32);
742742
#[derive(bevy_mod_scripting_lua_derive::LuaProxy)]
743743
#[proxy(
744744
derive(clone),
745-
remote = "bevy::input::touchpad::TouchpadRotate",
745+
remote = "bevy::input::touch::TouchpadRotate",
746746
functions[r#"
747747
748748
#[lua(
@@ -751,13 +751,13 @@ struct TouchpadMagnify(f32);
751751
composite = "eq",
752752
metamethod = "Eq",
753753
)]
754-
fn eq(&self, #[proxy] other: &touchpad::TouchpadRotate) -> bool;
754+
fn eq(&self, #[proxy] other: &touch::TouchpadRotate) -> bool;
755755
756756
"#,
757757
r#"
758758
759759
#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
760-
fn clone(&self) -> bevy::input::touchpad::TouchpadRotate;
760+
fn clone(&self) -> bevy::input::touch::TouchpadRotate;
761761
762762
"#,
763763
r#"
@@ -1525,8 +1525,8 @@ impl bevy_mod_scripting_core::hosts::APIProvider for BevyInputAPIProvider {
15251525
app.register_foreign_lua_type::<bevy::input::mouse::MouseWheel>();
15261526
app.register_foreign_lua_type::<bevy::input::touch::ForceTouch>();
15271527
app.register_foreign_lua_type::<bevy::input::touch::TouchPhase>();
1528-
app.register_foreign_lua_type::<bevy::input::touchpad::TouchpadMagnify>();
1529-
app.register_foreign_lua_type::<bevy::input::touchpad::TouchpadRotate>();
1528+
app.register_foreign_lua_type::<bevy::input::touch::TouchpadMagnify>();
1529+
app.register_foreign_lua_type::<bevy::input::touch::TouchpadRotate>();
15301530
app.register_foreign_lua_type::<bevy::input::gamepad::AxisSettings>();
15311531
app.register_foreign_lua_type::<bevy::input::gamepad::ButtonAxisSettings>();
15321532
app.register_foreign_lua_type::<bevy::input::gamepad::ButtonSettings>();

crates/languages/bevy_mod_scripting_lua/src/assets.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl AssetLoader for LuaLoader {
135135
reader: &'a mut Reader, //bytes: &'a [u8],
136136
_settings: &'a (),
137137
load_context: &'a mut bevy::asset::LoadContext,
138-
) -> bevy::asset::BoxedFuture<'a, Result<Self::Asset, Self::Error>> {
138+
) -> bevy::utils::BoxedFuture<'a, Result<Self::Asset, Self::Error>> {
139139
bevy::prelude::info!("lua loader invoked: {:#}", load_context.asset_path());
140140
Box::pin(async move {
141141
let mut bytes = Vec::new();

crates/macro_tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ debug = false
1515

1616
[dev-dependencies]
1717
trybuild = "1.0"
18-
bevy = { version = "0.13.1", default-features = false }
18+
bevy = { version = "0.14", default-features = false }
1919
bevy_mod_scripting = { path = "../../", features = [
2020
"lua",
2121
"lua_script_api",

makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ PACKAGE=bevy_mod_scripting
2121
TEST_NAME=
2222
# # valgrind outputs a callgrind.out.<pid>. We can analyze this with kcachegrind
2323
# kcachegrind
24-
NIGHTLY_VERSION=nightly-2024-01-24
25-
BEVY_VERSION=0.13.1
26-
GLAM_VERSION=0.25.0
24+
NIGHTLY_VERSION=nightly-2024-08-13
25+
BEVY_VERSION=0.14.1
26+
GLAM_VERSION=0.28.0
2727
CODEGEN_PATH=${PWD}/target/codegen
2828
BEVY_PATH=${CODEGEN_PATH}/bevy
2929
GLAM_PATH=${CODEGEN_PATH}/glam
3030
OUTPUT_PATH=${CODEGEN_PATH}/output
3131
GENERATED_SRC_PATH=./crates/bevy_script_api/src/providers
32-
GEN_BEVY_FEATURES=bevy_asset,bevy_gltf,bevy_animation,bevy_core_pipeline,bevy_ui,bevy_pbr,bevy_render,bevy_text,bevy_sprite,file_watcher,multi-threaded
32+
GEN_BEVY_FEATURES=bevy_asset,bevy_gltf,bevy_animation,bevy_core_pipeline,bevy_ui,bevy_pbr,bevy_render,bevy_text,bevy_sprite,file_watcher,multi_threaded
3333

3434
build_test_in_package:
3535
@cargo test --no-run --lib --workspace $(TEST_NAME)

readme.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,19 +201,21 @@ Documentation features are exposed at runtime via the `update_documentation` bui
201201
use bevy::prelude::*;
202202
use bevy_mod_scripting::prelude::*;
203203
204-
#[cfg(feature = "lua")]
205204
fn main() -> std::io::Result<()> {
206205
let mut app = App::new();
207206
208207
app.add_plugins(DefaultPlugins)
209-
.add_plugins(ScriptingPlugin)
210-
.add_script_host::<LuaScriptHost<()>>(PostUpdate)
208+
.add_plugins(ScriptingPlugin);
209+
#[cfg(feature = "lua")]
210+
{
211+
app.add_script_host::<LuaScriptHost<()>>(PostUpdate)
211212
// Note: This is a noop in optimized builds unless the `doc_always` feature is enabled!
212213
// this will pickup any API providers added *BEFOREHAND* like this one
213214
.add_api_provider::<LuaScriptHost<()>>(Box::new(LuaBevyAPIProvider))
214215
.add_api_provider::<LuaScriptHost<()>>(Box::new(LuaCoreBevyAPIProvider))
215216
.update_documentation::<LuaScriptHost<()>>()
216217
.add_script_handler::<LuaScriptHost<()>, 0, 0>(PostUpdate);
218+
}
217219
218220
Ok(())
219221
}
@@ -268,3 +270,10 @@ To see more complex applications of this library have a look at the examples:
268270

269271
Below is a video showcasing the game_of_life example:
270272
[![Watch the video](https://img.youtube.com/vi/Mo9gh2g3ZHw/maxresdefault.jpg)](https://www.youtube.com/watch?v=Mo9gh2g3ZHw)
273+
274+
# Compatibility
275+
276+
| bevy_mod_scripting | bevy |
277+
|---------------------|--------|
278+
| 0.7 | 0.14 |
279+
| 0.6 | 0.13.1 |

0 commit comments

Comments
 (0)