Cargo-generate template for Bevy projects
APACHE-2.0 License
This is a small but feature rich set of cargo-generate templates for use when creating Bevy applications.
Binary template for the main game binary.
wasm32-unknown-unknown
)
cargo build --features bevy/dynamic
.inspector
, the project will attempt to use [bevy-inspector-egui] (works with WASM).editor
, the project will attempt to use bevy_editor_pls.Library template for a small library crate.
Minimal template
Workflow template.
--init
parameter as it is not inteded as a complete project. The template must be expanded inside an existing project.To expand e.g a binary project, use:
cargo generate taurr/bevy-template-rs Binary
To include Github workflow files, use:
cd <PROJECT_DIR>
cargo generate taurr/bevy-template-rs Workflow --init --name <BINARY NAME>
Why the --init
parameter? Well thats just to tell cargo-generate not to create a folder for the generated files.
For further usage, or if having issues with cargo-generate
, please have a look in the cargo-generate book.
cargo-generate must be installed. The easiest way to do this is:
cargo install cargo-generate
If the template is used on a regular basis, cargo-generate allows to setup favorite templates and default variables.
To do this, open or create the file $CARGO_HOME/cargo-generate.toml
, insert this:
[values]
gh_username = "<YOUR GITHUB USERNAME>"
ide = "vscode|none"
[favorites.bevy-bin]
git = "https://github.com/taurr/bevy-template-rs"
subfolder = "Binary"
[favorites.bevy-lib]
git = "https://github.com/taurr/bevy-template-rs"
subfolder = "Library"
[favorites.bevy-wf]
git = "https://github.com/taurr/bevy-template-rs"
subfolder = "Workflow"
is_init = true
After this, the template can be expanded using cargo generate bevy-bin
, cargo generate bevy-lib
or cargo generate bevy-wf
.
⚠️ Adding the workflow template through this favorite will no longer require the --init
parameter, and thus will always expand in the current directory!