A third-party CLI utility for the Bevy game engine.

Overview

cargo-bavy Crates.io license: MIT/Apache-2.0

A third-party command-line utility for the Bevy game engine.

To not steal the cargo bevy command from the official Bevy maintainers, I chose cargo bavy instead.

Installation

cargo install cargo-bavy

Usage

Creating a new Bevy app

Run the following command:

cargo bavy new <FOLDER_NAME>

You can then select all the features that you want. Afterwards, a template project with the given name is created for you.

Running your game

Run the following command:

cargo bavy run

This works similar to cargo run, but automatically passes the --features bevy/dynamic flag to get faster compile times.

It also provides a --wasm/-w flag, which allows you to quickly test your game for the web. It will automatically compile your game for wasm32-unknown-unknown, bundle it with wasm-bindgen-cli and then serve it on a local webserver to be playable in your browser. All necessary tools will be installed for you if needed.

Building your game

Run the following command:

cargo bavy build

This works similar to cargo build, but automatically passes the --features bevy/dynamic flag to get faster compile times.

It also provides a --wasm/-w flag, which allows you to create a bundle for the web. It will automatically compile your game for wasm32-unknown-unknown and bundle it with wasm-bindgen-cli. All necessary tools will be installed for you if needed.

Check your code

Run the following command:

cargo bavy check

This works similar to cargo check, but automatically passes the --features bevy/dynamic flag to get faster compile times.

It also provides a --wasm/-w flag, which allows you to check for the WASM target.

Notes for usage with Rust Analyzer

If you are using cargo bavy with Rust Analyzer, you should configure it to use the --features bevy/dynamic flag in your project. Otherwise, its checks might interfere with your cargo bavy run usage, leading to many non-incremental re-compiles.

Create a .vscode/settings.json file in your project with the following content:

{
  "rust-analyzer.cargo.features": ["bevy/dynamic"]
}

This way, Rust Analyzer uses the same features as you.

License

The source code of this repository is dual-licensed under either:

at your option.

Your contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Comments
  • Dependency Optimization manifest key incorrect

    Dependency Optimization manifest key incorrect

    Using cargo-bavy it generates this:

    ["profile.dev"]
    opt-level = 1
    
    ["profile.dev.package.\"*\""]
    opt-level = 3
    

    Which produces the following warnings:

    warning: unused manifest key: profile.dev
    warning: unused manifest key: profile.dev.package."*"
    

    It should be:

    [profile.dev]
    opt-level = 1
    
    [profile.dev.package."*"]
    opt-level = 3
    
    bug 
    opened by paul-hansen 3
  • Should not include -Zshare-generics for non-nightly projects

    Should not include -Zshare-generics for non-nightly projects

    Creating a project with nightly toolchain disabled and fast linker enabled causes this error when running the project:

    error: the option `Z` is only accepted on the nightly compiler
    

    If the nightly toolchain is not selected, rustflags = ["-Zshare-generics=n"] should not be added to the .cargo/config.toml file as it is a nightly only feature.

    P.S. I was just thinking the other night about making something like this, thanks for making it!

    bug 
    opened by paul-hansen 1
  • Fix

    Fix "unused manifest key" warnings

    When using the optimized dependency configuration, you get the following warnings when running cargo check:

    warning: unused manifest key: profile.dev
    warning: unused manifest key: profile.dev.package."*"
    

    This seems to be because profile.dev and profile.dev.package."*" are quoted and apparently cargo can't handle that.

    We need to find a way to insert those tables without being quoted, unfortunately the documentation is quite sparse here.

    bug 
    opened by TimJentzsch 1
  • Add option to configure Rust Analyzer to use `bevy/dynamic` flag

    Add option to configure Rust Analyzer to use `bevy/dynamic` flag

    Closes #19.

    cargo bavy new now provides an option to configure Rust Analyzer in VS Code to use the bevy/dynamic feature.

    This reduces compile times and avoids unnecessary re-compilations when you use cargo bavy commands. It should be enabled on all projects where you use cargo bavy.

    opened by TimJentzsch 0
  • Automatically configure Rust Analyzer to use `bevy/dynamic` on check

    Automatically configure Rust Analyzer to use `bevy/dynamic` on check

    If you use cargo bavy run, it automatically passes --features bevy/dynamic for faster compiles. However, Rust Analyzer doesn't use this feature, so it re-compiles Bevy from scratch every time.

    cargo bavy new should automatically create a .vscode/settings.json file (if this is selected by the user), with the following content:

    {
      "rust-analyzer.cargo.features": ["bevy/dynamic"]
    }
    

    This way, Rust Analyzer uses the same features as the user, so every compile remains fast.

    enhancement 
    opened by TimJentzsch 0
  • Install wasm tools with `cargo bavy new`

    Install wasm tools with `cargo bavy new`

    Closes #14.

    cargo bavy new will now automatically install missing WASM tools if the WASM option has been selected.

    The cargo bavy new output is now also colorized and suggests using cargo bavy run instead of cargo run.

    opened by TimJentzsch 0
  • Add missing GitHub token to Clippy CI workflow

    Add missing GitHub token to Clippy CI workflow

    Fixes #15.

    This properly passes the GitHub token to the Clippy CI workflow. This allows the workflow to comment Clippy warnings on your PRs.

    I previously thought the token wasn't needed, but it was.

    opened by TimJentzsch 0
  • Add `cargo bavy check` command

    Add `cargo bavy check` command

    Closes #6.

    Adds a new cargo bavy check command that works similar to its cargo counterpart, but automatically passes --features bevy/dynamic in debug mode, for faster compile times. It also has a --wasm flag to quickly check for the web.

    opened by TimJentzsch 0
  • Add missing GitHub token to CI workflow

    Add missing GitHub token to CI workflow

    I removed a GitHub token reference from the CI workflow, thinking that it was useless. However, it allows the workflow to automatically comment clippy issues on PRs, so it should be added back.

    bug 
    opened by TimJentzsch 0
  • Add `cargo bavy build` command

    Add `cargo bavy build` command

    Closes #7.

    • Added cargo bavy build command. It works similar to its cargo counterpart, but automatically passes --features bevy/dynamic in debug builds for faster compile times. It also includes a --wasm/-w flag to bundle a binary for the web.
    • Refactored ArgBuilder to be a lot less verbose to use.
    opened by TimJentzsch 0
  • Fix shared generics flag being enabled on stable config

    Fix shared generics flag being enabled on stable config

    Fixes #10.

    There was one shared generic flag left in the linker configuration with stable toolchain, this has now been fixed to only be included on nightly Rust.

    opened by TimJentzsch 0
  • Add support for `cargo bavy new --lib`

    Add support for `cargo bavy new --lib`

    Just like with cargo new, you should be able to pass a --lib flag to create a library instead of a binary project. The feature selection should be adapted to make sense for libraries.

    enhancement 
    opened by TimJentzsch 0
  • Improve error handling

    Improve error handling

    Currently, the program just panics with an error message when something goes wrong. Ideally, we'd have better and prettier errors that are more helpful to the user.

    enhancement 
    opened by TimJentzsch 0
Releases(v0.2.0)
  • v0.2.0(Aug 20, 2022)

    Enhancements

    • Added cargo bavy check, cargo bavy build and cargo bavy run commands:
      • They work similar to cargo their counterpart.
      • They automatically add --features bevy/dynamic in debug mode for faster compile times.
      • They have an additional --wasm/-w flag to target the browser.
      • All necessary tools will be installed for you if needed.
    • Changed cargo bavy new to add .gitignore file to the wasm/ folder with the WASM option.
    • Changed cargo bavy new to automatically install needed tools when WASM option is selected.
    • Added option to cargo bavy new to configure Rust Analyzer in VS Code to use bevy/dynamic feature.
      • This avoids unnecessary re-compiles after you use cargo bavy run and other commands.
      • You should configure this for all projects where you use cargo-bavy.

    Usability

    • Changed cargo bavy new to colorize output.
    • Changed cargo bavy new to suggest running cargo bavy run instead of cargo run.

    Bug fixes

    • Fixed optimized dependency configuration having invalid table keys in Cargo.toml.
    • Fixed fast linker configuration including a shared generics flag on stable toolchain, which caused a compile error.
    • Fixed Clippy CI workflow not including GitHub token, so it wouldn't post comments with the warnings on your PRs.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Aug 20, 2022)

    The initial release!

    Installation

    cargo install cargo-bavy
    

    Usage

    Create a new Bevy app:

    cargo bavy new <PROJECT_NAME>
    

    It will ask you which features you want (asset hot reloading, fast linker, GitHub Action workflows, ...) and then creates a project template for you.

    Source code(tar.gz)
    Source code(zip)
Owner
Volunteer work for @GrafeasGroup.
null
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023
2d Endless Runner Game made with Bevy Game Engine

Cute-runner A 2d Endless Runner Game made with Bevy Game Engine. Table of contents Project Infos Usage Screenshots Disclaimer Project Infos Date: Sept

JoaoMarinho 2 Jul 15, 2022
A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Michael Dorst 0 Dec 26, 2021
A game made in one week for the Bevy engine's first game jam

¿Quien es el MechaBurro? An entry for the first Bevy game jam following the theme of "Unfair Advantage." It was made in one week using the wonderful B

mike 20 Dec 23, 2022
A Client/Server game networking plugin using QUIC, for the Bevy game engine.

Bevy Quinnet A Client/Server game networking plugin using QUIC, for the Bevy game engine. Bevy Quinnet QUIC as a game networking protocol Features Roa

Gilles Henaux 65 Feb 20, 2023
Basic first-person fly camera for the Bevy game engine

bevy_flycam A basic first-person fly camera for Bevy 0.4 Controls WASD to move horizontally SPACE to ascend LSHIFT to descend ESC to grab/release curs

Spencer Burris 85 Dec 23, 2022
Inspector plugin for the bevy game engine

bevy-inspector-egui This crate provides the ability to annotate structs with a #[derive(Inspectable)], which opens a debug interface using egui where

Jakob Hellermann 517 Dec 31, 2022
Crossterm plugin for the bevy game engine

What is bevy_crossterm? bevy_crossterm is a Bevy plugin that uses crossterm as a renderer. It provides custom components and events which allow users

null 79 Nov 2, 2022
Concise Reference Book for the Bevy Game Engine

Unofficial Bevy Cheat Book Click here to read the book! Concise reference to programming in the Bevy game engine. Covers useful syntax, features, prog

null 947 Jan 8, 2023
Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions

Introduction Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions. (hand interaction with boxes missing

Mika 52 Nov 14, 2022
A physics lib for the bevy game engine based on physme

physimple Physimple aims to be the simplest(and capable) physics engine(currently for bevy) WARNING Beware for breaking changes with each update for n

null 24 Oct 28, 2022
An immediate mode 2D drawing API for Bevy game engine

Bevy Canvas API prototype An unofficial immediate mode 2D drawing API for Bevy game engine. Check the documentation or the examples to know how to use

Federico Rinaldi 20 Apr 21, 2022
Simple RUST game with the Bevy Engine

Simple RUST Game using the Bevy Engine YouTube videos for this code base: Episode 1 - Rust Game Development tutorial from Scratch with Bevy Engine Epi

null 150 Jan 7, 2023
A vdom-free reactive UI lib for the bevy game engine

ui4 ui4 is my fourth major attempt at making a UI dataflow library for the Bevy game engine. More specifically, it's a vdom-less UI library which uses

null 48 Nov 28, 2022
Hanabi — a particle system plugin for the Bevy game engine.

Hanabi — a particle system plugin for the Bevy game engine

Jerome Humbert 256 Dec 30, 2022
Brine is my attempt at writing a Minecraft client in Rust using the Bevy game engine.

Brine Brine is my attempt at writing a Minecraft client in Rust using the Bevy game engine. It's EXTREMELY work-in-progress. The thing that makes Brin

Ben Reeves 34 Dec 26, 2022
Bevy is a refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

John Winston 3 Jun 3, 2022
Plotting library for the Bevy game engine with a focus on esthetics and interactivity

Plotting library for the Bevy game engine with a focus on esthetics and interactivity. It can handle both data points (see the "minimal", "markers", a

Eli 40 Dec 25, 2022
Utilities for creating strictly ordered execution graphs of systems for the Bevy game engine

bevy_system_graph This crate provides the utilities for creating strictly ordered execution graphs of systems for the Bevy game engine. Bevy Version S

Hourai Teahouse 19 Dec 2, 2022