chore: enable bevy/debug and bevy/track_location by default via dev feature
Cargo features cannot be scoped to a build profile, so add a `dev` feature
that pulls in `bevy/debug` and `bevy/track_location` and make it a default
feature. This surfaces real type names and source locations in ECS panics
(e.g. B0001 query conflicts) for normal `cargo build` / `cargo run` /
`cargo test`, at the cost of a small overhead. Shipping builds opt out
with `--release --no-default-features`.
Removes the now-redundant `[dev-dependencies] bevy = { features = ["debug"] }`
override, since the default feature already covers test builds.
This commit is contained in:
parent
3e41c9130e
commit
80b8e665f7
2 changed files with 13 additions and 3 deletions
|
|
@ -3,12 +3,13 @@ name = "bglga"
|
|||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
default = ["dev"]
|
||||
dev = ["bevy/debug", "bevy/track_location"]
|
||||
|
||||
[dependencies]
|
||||
bevy = "0.18"
|
||||
fastrand = "2.0.1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
dirs = "6"
|
||||
|
||||
[dev-dependencies]
|
||||
bevy = { version = "0.18", features = ["debug"] }
|
||||
|
|
|
|||
|
|
@ -28,6 +28,15 @@ The game features:
|
|||
nix develop --command cargo build
|
||||
```
|
||||
|
||||
The `dev` cargo feature is enabled by default and turns on `bevy/debug` and
|
||||
`bevy/track_location` so ECS panics (e.g. `B0001` query conflicts) report
|
||||
real type names and source locations. For a shipping release build, disable
|
||||
it:
|
||||
|
||||
```
|
||||
nix develop --command cargo build --release --no-default-features
|
||||
```
|
||||
|
||||
## How to Test
|
||||
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue