Skip to content

Commit 1e08639

Browse files
authored
Merge pull request #27 from makspll/feature/individual_script_host_crates
Feature/individual script host crates
2 parents 016c54b + 8dee00d commit 1e08639

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2319
-1896
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ name: Check and Lint
1010
jobs:
1111
check:
1212
name: Check
13-
runs-on: ubuntu-latest
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [windows-latest, ubuntu-latest, macOS-latest]
1417
steps:
1518
- name: Install alsa and udev
1619
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
20+
if: runner.os == 'linux'
1721
- uses: actions/checkout@v2
1822
- uses: actions-rs/toolchain@v1
1923
with:
@@ -24,7 +28,7 @@ jobs:
2428
- uses: actions-rs/cargo@v1
2529
with:
2630
command: check
27-
args: --features=lua54,teal
31+
args: --workspace --features=lua54,rhai,teal,lua_script_api,rhai_script_api
2832

2933
fmt:
3034
name: Rustfmt
@@ -61,4 +65,4 @@ jobs:
6165
- uses: actions-rs/cargo@v1
6266
with:
6367
command: clippy
64-
args: --features=lua54,teal -- -D warnings
68+
args: --features=lua54,rhai,teal,lua_script_api,rhai_script_api -- -D warnings

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Cargo.lock
99
# These are backup files generated by rustfmt
1010
**/*.rs.bk
1111

12-
.vscode/
13-
1412
**types/
1513
**/doc
1614
assets/scripts/tlconfig.lua

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
"rust-analyzer.cargo.features": [
88
"lua54",
9-
"teal",
9+
"lua_script_api",
10+
"rhai",
11+
"rhai_script_api",
12+
"teal"
1013
],
1114
"rust-analyzer.server.extraEnv": {
1215
"RUSTUP_TOOLCHAIN": "stable"

Cargo.toml

Lines changed: 73 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.1"
44
authors = ["Maksymilian Mozolewski <[email protected]>"]
55
edition = "2021"
66
license = "MIT"
7-
description = "Bevy plugin for enabling scripting"
7+
description = "Multi language scripting in Bevy"
88
repository = "https://github.com/makspll/bevy_mod_scripting"
99
homepage = "https://github.com/makspll/bevy_mod_scripting"
1010
keywords = ["bevy", "gamedev", "scripting", "lua"]
@@ -16,58 +16,77 @@ include= ["readme.md","/src","/examples","/assets","LICENSE"]
1616
name = "bevy_mod_scripting"
1717
path = "src/lib.rs"
1818

19-
[package.metadata.docs.rs]
20-
features = ["lua54","teal","unsafe_lua_modules"]
21-
22-
[package.metadata.release]
23-
enable-features=["lua54"]
19+
[package.metadata."docs.rs"]
20+
features = ["lua","rhai","lua_script_api","rhai_script_api","teal"]
2421

2522
[features]
23+
## core
24+
doc_always = ["bevy_mod_scripting_core/doc_always"]
25+
26+
## lua
27+
lua = ["bevy_mod_scripting_lua"]
28+
# one of these must be selected
29+
lua51 = ["bevy_mod_scripting_lua/lua51", "lua"]
30+
lua52 = ["bevy_mod_scripting_lua/lua52", "lua"]
31+
lua53 = ["bevy_mod_scripting_lua/lua53", "lua"]
32+
lua54 = ["bevy_mod_scripting_lua/lua54", "lua"]
33+
luajit = ["bevy_mod_scripting_lua/luajit", "lua"]
34+
luajit52 = ["bevy_mod_scripting_lua/luajit52", "lua"]
35+
36+
# optional
37+
lua_script_api=["bevy_script_api/lua"]
38+
unsafe_lua_modules=["bevy_mod_scripting_lua/unsafe_lua_modules"]
39+
teal = ["bevy_mod_scripting_lua/teal"]
40+
mlua_serialize = ["bevy_mod_scripting_lua/mlua_serialize"]
41+
mlua_macros = ["bevy_mod_scripting_lua/mlua_macros"]
42+
43+
## rhai
44+
rhai = ["bevy_mod_scripting_rhai"]
45+
rhai_script_api=["bevy_script_api/rhai"]
2646

27-
# if enabled enables documentation updating in optimized builds
28-
doc_always = []
47+
[dependencies]
48+
bevy_mod_scripting_core = { path = "bevy_mod_scripting_core", version = "0.1.1" }
49+
bevy_mod_scripting_lua = { path = "languages/bevy_mod_scripting_lua", version = "0.1.1", optional = true }
50+
bevy_mod_scripting_rhai = { path = "languages/bevy_mod_scripting_rhai", version = "0.1.1", optional = true}
51+
bevy_script_api = { path = "bevy_script_api", version = "0.1.1", optional = true }
2952

30-
# enables loading possibly unsafe lua modules by lua scripts
31-
unsafe_lua_modules = []
53+
[dev-dependencies]
54+
bevy = { version = "0.8.0"}
55+
rand = "0.8.5"
3256

33-
# enable teal utilities
34-
teal = []
3557

58+
# bevy_console = { git = "https://github.com/OnlyGraphs/bevy-console" }
59+
# bevy_asset_loader = {git = "https://github.com/NiklasEi/bevy_asset_loader", features = ["dynamic_assets"]}
60+
# bevy_script_api= {path="./bevy_script_api", version="0.1.1", features=["lua","rhai"]}
61+
# bevy_mod_scripting_rhai = {path="languages/bevy_mod_scripting_rhai", version="0.1.1"}
62+
# bevy_mod_scripting_lua = {path="languages/bevy_mod_scripting_lua", version="0.1.1", features=["lua54"]}
63+
# bevy_mod_scripting_lua_derive = {path="languages/bevy_mod_scripting_lua_derive", version="0.1.1"}
3664

37-
lua51 = ["tealr/mlua_lua51"]
38-
lua52 = ["tealr/mlua_lua52"]
39-
lua53 = ["tealr/mlua_lua53"]
40-
lua54 = ["tealr/mlua_lua54"]
41-
luajit = ["tealr/mlua_luajit"]
42-
luajit52 = ["tealr/mlua_luajit52"]
65+
# bevy = { version = "0.8.0"}
66+
# serde = "1.0.137"
67+
# criterion = "0.3"
4368

44-
mlua_serialize = ["tealr/mlua_serialize"]
45-
mlua_macros = ["tealr/mlua_macros"]
4669

47-
[dependencies]
48-
bevy = { version = "0.8.0", default-features = false, features=["bevy_asset","bevy_gltf","bevy_animation","bevy_core_pipeline","bevy_ui","bevy_pbr","bevy_render","bevy_text","bevy_sprite","filesystem_watcher"]}
49-
tealr = { version = "0.9.0-alpha1", features=["mlua_vendored","mlua_send"]}
50-
rhai = { version = "1.7.0", features = ["sync"] }
51-
anyhow = "1.0.57"
52-
once_cell = "1.10.0"
53-
bevy_event_priority = {path = "bevy_event_priority", version = "0.1.1"}
54-
bevy_mod_scripting_derive = {path = "bevy_mod_scripting_derive", version = "0.1.1"}
55-
thiserror = "1.0.31"
56-
lazy_static = "1.4.0"
57-
paste = "1.0.7"
58-
parking_lot = "0.12.1"
59-
serde_json = "1.0.81"
60-
num-traits = "0.2.15"
61-
serde = { version = "1", features = ["derive"] }
62-
smallvec = "1.9.0"
70+
[workspace]
71+
resolver = "2"
72+
members = [
73+
"bevy_mod_scripting_core",
74+
"bevy_event_priority",
75+
"bevy_mod_scripting_derive",
76+
"bevy_api_gen",
77+
"bevy_script_api",
78+
"languages/bevy_mod_scripting_lua",
79+
"languages/bevy_mod_scripting_lua_derive",
80+
"languages/bevy_mod_scripting_rhai",
81+
# "languages/rhai/derive",
82+
"bevy_mod_scripting_common"
83+
]
6384

64-
[dev-dependencies]
65-
# bevy_console = { git = "https://github.com/OnlyGraphs/bevy-console" }
66-
# bevy_asset_loader = {git = "https://github.com/NiklasEi/bevy_asset_loader", features = ["dynamic_assets"]}
67-
bevy = { version = "0.8.0"}
68-
rand = "0.8.5"
69-
serde = "1.0.137"
70-
criterion = "0.3"
85+
[profile.dev]
86+
opt-level = 1
87+
88+
[profile.dev.package."*"]
89+
opt-level = 3
7190

7291

7392
# needs bevy 0.8 support from console
@@ -84,45 +103,38 @@ criterion = "0.3"
84103
[[example]]
85104
name = "complex_game_loop_lua"
86105
path = "examples/lua/complex_game_loop.rs"
87-
required-features = ["lua54"]
106+
required-features=["lua54"]
88107

89108
[[example]]
90109
name = "game_of_life_lua"
91110
path = "examples/lua/game_of_life.rs"
92-
required-features = ["lua54","teal"]
111+
required-features=["lua54","teal","lua_script_api"]
93112

94113
[[example]]
95114
name = "event_recipients_lua"
96115
path = "examples/lua/event_recipients.rs"
116+
required-features=["lua54"]
97117

98118
[[example]]
99119
name = "documentation_gen_lua"
100120
path = "examples/lua/documentation_gen.rs"
101-
required-features = ["lua54"]
121+
required-features=["lua54","teal","lua_script_api"]
102122

103123

104124
[[example]]
105125
name = "bevy_api_lua"
106126
path = "examples/lua/bevy_api.rs"
107-
required-features = ["lua54"]
127+
required-features=["lua54","lua_script_api"]
128+
129+
[[example]]
130+
name = "bevy_api_rhai"
131+
path = "examples/rhai/bevy_api.rs"
132+
required-features=["rhai"]
108133

109134
[[example]]
110135
name = "wrappers"
111136
path = "examples/wrappers.rs"
112-
required-features = ["lua54"]
137+
required-features=["lua54","lua_script_api"]
113138

114139

115-
[workspace]
116-
resolver = "2"
117-
members = [
118-
"bevy_event_priority",
119-
"bevy_mod_scripting_derive",
120-
"bevy_api_gen"
121-
]
122-
123-
[profile.dev]
124-
opt-level = 1
125-
126-
[profile.dev.package."*"]
127-
opt-level = 3
128140

0 commit comments

Comments
 (0)