Skip to content

Commit efa4115

Browse files
Bevy 0.15 Support (#141)
* Bevy 0.15 Support (#139) * bump bevy to 0.15.0-rc.2 * migrate asset loaders * Upgrade reflection API's * bump codegen & codegen new files * Fix errors + regen * pin git again * fix more errors * bump macro tests * clippy fixes to bevy api gen * more bevy api gen clippy fixes * Update game of life examples * fix clippy * fix more clippy * fix more clippy * bump versions to alpha * Fix typo in workflow (#142) fix typo * Bump Bevy release candidate (#143) * bump release candidate * bump release candidate * optimize ci matrix * don't run many checks on same branch * add missing example link * fix missing commas * fix missing dolah * chore: release v0.8.0-alpha.1 (#145) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix failing doctest (#146) fix doctest * fix: bug when compiling without `teal` feature (#148) fix failing doctest logic * Bump bevy & bevy console (#153) * bump bevy console * bump rest of bevy * remove bevy_gltf * Luau support attempt (#154) * try add support for luau * add luau feature to ci * Small fixes (#155) * Update readme * fix clippy * fix more clippy * Begin work on docs book (#156) * init mdbook * Add workflow * trigger ci * fix install * re-trigger * fix typo * fix working dir * fix working dir * chore: release v0.8.0-alpha.2 (#147) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: Require conventional titles (#157) * add pr title workflow * allow chore --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 99460d1 commit efa4115

Some content is hidden

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

69 files changed

+7548
-5868
lines changed

.github/workflows/bevy_api_gen.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions-rs/toolchain@v1
2626
with:
2727
profile: minimal
28-
toolchain: nightly-2024-05-20
28+
toolchain: nightly-2024-11-05
2929
override: true
3030
- name: Rust Cache
3131
uses: Swatinem/[email protected]
@@ -52,7 +52,7 @@ jobs:
5252
with:
5353
profile: minimal
5454
components: rustfmt
55-
toolchain: nightly-2024-05-20
55+
toolchain: nightly-2024-11-05
5656
override: true
5757
- name: Rust Cache
5858
uses: Swatinem/[email protected]
@@ -75,7 +75,7 @@ jobs:
7575
rm -rf crates
7676
- uses: actions-rs/toolchain@v1
7777
with:
78-
toolchain: nightly-2024-05-20
78+
toolchain: nightly-2024-11-05
7979
components: clippy
8080
override: true
8181
- name: Rust Cache
@@ -98,7 +98,7 @@ jobs:
9898
rm -rf crates
9999
- uses: actions-rs/toolchain@v1
100100
with:
101-
toolchain: nightly-2024-05-20
101+
toolchain: nightly-2024-11-05
102102
override: true
103103
- name: Rust Cache
104104
uses: Swatinem/[email protected]
@@ -120,7 +120,7 @@ jobs:
120120
rm -rf crates
121121
- uses: actions-rs/toolchain@v1
122122
with:
123-
toolchain: nightly-2024-05-20
123+
toolchain: nightly-2024-11-05
124124
override: true
125125
- name: Rust Cache
126126
uses: Swatinem/[email protected]

.github/workflows/bevy_mod_scripting.yml

+21-11
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,36 @@ on:
88
- '.github/workflows/release-plz.yml'
99
- '.github/workflows/bevy_api_gen.yml'
1010
- '.github/workflows/macro_tests.yml'
11+
- 'docs/**'
1112

1213

1314
name: Check and Lint - bevy_mod_scripting
1415

16+
concurrency:
17+
# Use github.run_id on main branch
18+
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
19+
# Use github.ref on other branches, so it's unique per branch
20+
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
1523
jobs:
1624
check:
17-
name: Check
25+
name: Check - ${{ matrix.run_args.label }}
1826
runs-on: ${{ matrix.run_args.os }}
1927
strategy:
2028
matrix:
2129
run_args: [
22-
{os: windows-latest, lua: lua54, cross: x86_64-pc-windows-msvc},
23-
{os: macOS-latest, lua: lua54, cross: x86_64-apple-darwin},
24-
{os: ubuntu-latest, lua: lua54, cross: aarch64-unknown-linux-gnu},
25-
{os: ubuntu-latest, lua: lua51, cross: x86_64-unknown-linux-gnu},
26-
{os: ubuntu-latest, lua: lua52, cross: x86_64-unknown-linux-gnu},
27-
{os: ubuntu-latest, lua: lua53, cross: x86_64-unknown-linux-gnu},
28-
{os: ubuntu-latest, lua: lua54, cross: x86_64-unknown-linux-gnu},
29-
{os: ubuntu-latest, lua: luajit, cross: x86_64-unknown-linux-gnu},
30-
{os: ubuntu-latest, lua: luajit52, cross: x86_64-unknown-linux-gnu}
30+
{label: Windows - All Features, os: windows-latest, features: "lua54,rhai,teal,lua_script_api,rhai_script_api,rune", cross: x86_64-pc-windows-msvc },
31+
{label: MacOS - All Features, os: macOS-latest, features: "lua54,rhai,teal,lua_script_api,rhai_script_api,rune", cross: x86_64-apple-darwin },
32+
{label: Ubuntu - All Features, os: ubuntu-latest, features: "lua54,lua_script_api,rhai,teal,rhai_script_api,rune", cross: x86_64-unknown-linux-gnu },
33+
{label: Ubuntu Aarch64 - All Features, os: ubuntu-latest, features: "lua54,rhai,teal,lua_script_api,rhai_script_api,rune", cross: aarch64-unknown-linux-gnu },
34+
{label: Ubuntu - Lua51, os: ubuntu-latest, features: "lua51,lua_script_api", cross: x86_64-unknown-linux-gnu },
35+
{label: Ubuntu - Lua52, os: ubuntu-latest, features: "lua52,lua_script_api", cross: x86_64-unknown-linux-gnu },
36+
{label: Ubuntu - Lua53, os: ubuntu-latest, features: "lua53,lua_script_api", cross: x86_64-unknown-linux-gnu },
37+
{label: Ubuntu - Luajit, os: ubuntu-latest, features: "luajit,lua_script_api", cross: x86_64-unknown-linux-gnu },
38+
{label: Ubuntu - Luajit52, os: ubuntu-latest, features: "luajit52,lua_script_api", cross: x86_64-unknown-linux-gnu },
39+
{label: Ubuntu - Luau, os: ubuntu-latest, features: "luau,lua_script_api", cross: x86_64-unknown-linux-gnu }
40+
3141
]
3242
steps:
3343
- if: runner.os == 'linux'
@@ -48,7 +58,7 @@ jobs:
4858
with:
4959
command: check
5060
target: ${{ matrix.run_args.cross }}
51-
args: --workspace --features=${{ matrix.run_args.lua }},rhai,teal,lua_script_api,rhai_script_api,rune --profile=ephemeral-build
61+
args: --workspace --features=${{ matrix.run_args.features }} --profile=ephemeral-build
5262

5363
fmt:
5464
name: Rustfmt

.github/workflows/mdbook.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy mdBook to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
paths:
8+
- 'docs/**'
9+
- '.github/workflows/mdbook.yml'
10+
11+
jobs:
12+
13+
build:
14+
name: Build Book - mdbook
15+
runs-on: ubuntu-latest
16+
steps:
17+
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
override: true
25+
- name: Rust Cache
26+
uses: Swatinem/[email protected]
27+
- name: Install mdBook
28+
run: cargo install mdbook
29+
30+
- name: Build the book
31+
run: cd docs && mdbook build
32+
33+
- name: Deploy to GitHub Pages
34+
if: github.ref == 'refs/heads/main'
35+
uses: peaceiris/actions-gh-pages@v3
36+
with:
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
publish_dir: docs/book

.github/workflows/pr-titles.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Lint PR"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
- reopened
10+
11+
permissions:
12+
pull-requests: read
13+
14+
jobs:
15+
main:
16+
name: Validate PR title
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@v5
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
with:
23+
types: |
24+
fix
25+
feat
26+
chore

.github/workflows/release-plz.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ permissions:
77
on:
88
push:
99
branches:
10-
- [main, staging]
10+
- main
11+
- staging
1112

1213
jobs:
1314

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## [0.8.0-alpha.2](https://github.com/makspll/bevy_mod_scripting/compare/v0.8.0-alpha.1...v0.8.0-alpha.2) - 2024-12-03
4+
5+
### Fixed
6+
7+
- bug when compiling without `teal` feature ([#148](https://github.com/makspll/bevy_mod_scripting/pull/148))
8+
9+
### Other
10+
11+
- Small fixes ([#155](https://github.com/makspll/bevy_mod_scripting/pull/155))
12+
- Luau support attempt ([#154](https://github.com/makspll/bevy_mod_scripting/pull/154))
13+
- Bump bevy & bevy console ([#153](https://github.com/makspll/bevy_mod_scripting/pull/153))
14+
- Fix failing doctest ([#146](https://github.com/makspll/bevy_mod_scripting/pull/146))
15+
- update Cargo.toml dependencies
16+
17+
## [0.8.0-alpha.1](https://github.com/makspll/bevy_mod_scripting/compare/v0.8.0-alpha.0...v0.8.0-alpha.1) - 2024-11-10
18+
19+
### Other
20+
21+
- Bump Bevy release candidate ([#143](https://github.com/makspll/bevy_mod_scripting/pull/143))
22+
- update Cargo.toml dependencies
23+
324
## [0.7.1](https://github.com/makspll/bevy_mod_scripting/compare/bevy_mod_scripting-v0.7.0...bevy_mod_scripting-v0.7.1) - 2024-11-03
425

526
### Other

Cargo.toml

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bevy_mod_scripting"
3-
version = "0.7.1"
3+
version = "0.8.0-alpha.2"
44
authors = ["Maksymilian Mozolewski <[email protected]>"]
55
edition = "2021"
66
license = "MIT OR Apache-2.0"
@@ -44,6 +44,7 @@ lua53 = ["bevy_mod_scripting_lua/lua53", "lua"]
4444
lua54 = ["bevy_mod_scripting_lua/lua54", "lua"]
4545
luajit = ["bevy_mod_scripting_lua/luajit", "lua"]
4646
luajit52 = ["bevy_mod_scripting_lua/luajit52", "lua"]
47+
luau = ["bevy_mod_scripting_lua/luau", "lua"]
4748

4849
# optional
4950
lua_script_api = ["bevy_script_api/lua"]
@@ -63,22 +64,22 @@ rune = ["bevy_mod_scripting_rune"]
6364
[dependencies]
6465
bevy = { workspace = true }
6566
bevy_mod_scripting_core = { workspace = true }
66-
bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.7.1", optional = true }
67-
bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.7.1", optional = true }
68-
bevy_mod_scripting_rune = { path = "crates/languages/bevy_mod_scripting_rune", version = "0.7.1", optional = true }
69-
bevy_script_api = { path = "crates/bevy_script_api", version = "0.7.1", optional = true }
67+
bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.8.0-alpha.2", optional = true }
68+
bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.8.0-alpha.2", optional = true }
69+
bevy_mod_scripting_rune = { path = "crates/languages/bevy_mod_scripting_rune", version = "0.8.0-alpha.2", optional = true }
70+
bevy_script_api = { path = "crates/bevy_script_api", version = "0.8.0-alpha.2", optional = true }
7071

7172

7273
[workspace.dependencies]
73-
bevy = { version = "0.14.2", default-features = false }
74-
bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.7.1" }
75-
bevy_mod_scripting_common = { path = "crates/bevy_mod_scripting_common", version = "0.7.1" }
74+
bevy = { version = "0.15.0", default-features = false }
75+
bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.8.0-alpha.2" }
76+
bevy_mod_scripting_common = { path = "crates/bevy_mod_scripting_common", version = "0.8.0-alpha.2" }
7677

7778
[dev-dependencies]
7879
bevy = { workspace = true, default-features = true }
7980
clap = { version = "4.1", features = ["derive"] }
8081
rand = "0.8.5"
81-
bevy_console = "0.12"
82+
bevy_console = "0.13"
8283
rhai-rand = "0.1"
8384

8485
[workspace]

check.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CURRENT_DIR=$(basename "$PWD")
44

55

66
if [[ "$CURRENT_DIR" == "bevy_api_gen" ]]; then
7-
cargo +nightly-2024-05-20 clippy --all-targets --message-format=json
7+
cargo +nightly-2024-11-05 clippy --all-targets --message-format=json
88
else
99
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"
1010
fi

crates/bevy_api_gen/Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,16 @@ source = "discover"
3737
rustc_private = true
3838

3939
[rust-analyzer.check]
40-
overrideCommand = ["cargo", "+nightly-2024-05-20", "a", "--message-format=json"]
40+
overrideCommand = ["cargo", "+nightly-2024-11-05", "a", "--message-format=json"]
4141

4242

4343
[dependencies]
4444
log = "0.4"
4545
env_logger = "0.11"
46-
rustc_plugin = "=0.10.0-nightly-2024-05-20"
46+
rustc_plugin = { git = "https://github.com/makspll/rustc_plugin", branch = "feature/rust-1.82.0" }
4747
indexmap = "2"
4848
tempdir = "0.3"
4949
cargo_metadata = "0.18"
50-
rustc_data_structures = "0.0.1"
5150
serde_json = "1"
5251
serde = "1"
5352
clap = { version = "4", features = ["derive", "string"] }

crates/bevy_api_gen/readme.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ bevy_api_gen is a Cargo plugin that generates reflection-powered wrappers for Be
88
To install bevy_api_gen, use the following command:
99

1010
```bash
11-
cargo +nightly-2024-05-20 install bevy_api_gen
11+
cargo +nightly-2024-11-05 install bevy_api_gen
1212
```
1313

1414
# Usage
@@ -18,39 +18,39 @@ cargo +nightly-2024-05-20 install bevy_api_gen
1818
To run the main codegen process, use the following command:
1919

2020
```bash
21-
cargo +nightly-2024-05-20 bevy-api-gen generate
21+
cargo +nightly-2024-11-05 bevy-api-gen generate
2222
```
2323

24-
This will perform all parts of the process and generate meta as well as .rs files for each crate in your workspace in your `/target/plugin-nightly-2024-05-20/bevy_api_gen` directory
24+
This will perform all parts of the process and generate meta as well as .rs files for each crate in your workspace in your `/target/plugin-nightly-2024-11-05/bevy_api_gen` directory
2525

2626
## Collect
2727

2828
After generating all the files, you can 'collect' them in a mod.rs file like so:
2929

3030
```bash
31-
cargo +nightly-2024-05-20 bevy-api-gen collect
31+
cargo +nightly-2024-11-05 bevy-api-gen collect
3232
```
3333

3434
## List Types
3535

3636
To see a list of all `Reflect` implementing types in your workspace run:
3737

3838
```bash
39-
cargo +nightly-2024-05-20 bevy-api-gen list-types > all_types.txt
39+
cargo +nightly-2024-11-05 bevy-api-gen list-types > all_types.txt
4040
```
4141

4242
## List Templates
4343

4444
To see the list of all templates which you can override use:
4545

4646
```bash
47-
cargo +nightly-2024-05-20 bevy-api-gen list-templates
47+
cargo +nightly-2024-11-05 bevy-api-gen list-templates
4848
```
4949

5050
## Print Template
5151

5252
You can also print any of the templates to stdout:
5353

5454
```bash
55-
cargo +nightly-2024-05-20 bevy-api-gen print item.tera
55+
cargo +nightly-2024-11-05 bevy-api-gen print item.tera
5656
```
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
22
components = ["clippy", "rust-src", "rustc-dev", "llvm-tools"]
3-
channel = "nightly-2024-05-20"
3+
channel = "nightly-2024-11-05"

crates/bevy_api_gen/src/bin/driver.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![feature(rustc_private)]
12
use bevy_api_gen::*;
23

34
fn main() {

crates/bevy_api_gen/src/bin/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![feature(rustc_private)]
12
use std::{
23
collections::HashMap,
34
env,

crates/bevy_api_gen/src/context.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ impl CachedTraits {
138138
.all(|t| self.std_source_traits.contains_key(*t))
139139
}
140140

141-
pub(crate) fn missing_std_source_traits(&self) -> Vec<String> {
142-
STD_SOURCE_TRAITS
143-
.iter()
144-
.filter(|t| !self.std_source_traits.contains_key(**t))
145-
.map(|s| (*s).to_owned())
146-
.collect()
147-
}
141+
// pub(crate) fn missing_std_source_traits(&self) -> Vec<String> {
142+
// STD_SOURCE_TRAITS
143+
// .iter()
144+
// .filter(|t| !self.std_source_traits.contains_key(**t))
145+
// .map(|s| (*s).to_owned())
146+
// .collect()
147+
// }
148148
}
149149

150150
#[derive(Clone, Debug)]

crates/bevy_api_gen/src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#![feature(rustc_private, let_chains)]
22
#![deny(rustc::internal)]
3+
34
extern crate rustc_ast;
45
extern crate rustc_driver;
56
extern crate rustc_errors;
67
extern crate rustc_hir;
7-
extern crate rustc_hir_analysis;
88
extern crate rustc_infer;
99
extern crate rustc_interface;
10-
extern crate rustc_lint;
1110
extern crate rustc_middle;
12-
extern crate rustc_session;
1311
extern crate rustc_span;
1412
extern crate rustc_trait_selection;
1513

crates/bevy_api_gen/src/meta.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl MetaLoader {
9494
let cache = self.cache.borrow();
9595
if cache.contains_key(crate_name) {
9696
trace!("Loading meta from cache for: {}", crate_name);
97-
return cache.get(crate_name).cloned();
97+
cache.get(crate_name).cloned()
9898
} else {
9999
trace!("Loading meta from filesystem for: {}", crate_name);
100100
drop(cache);

0 commit comments

Comments
 (0)