-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add build
and run
commands
#24
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
/// Determine the name of the cargo package. | ||
pub(crate) fn package_name() -> anyhow::Result<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can potentially be replaced by parsing the output of the cargo metadata
command
Can this run another binary than |
That's not supported at the moment, I wasn't aware of that. |
This allows us to provide web-specific arguments
Now the structure matches the sub headings in the cargo help output
Further work towards #24 `wasm_bindgen` is used to generate JS bindings for the WASM executable.
Objective
Easily build and run your Bevy app.
Especially for the web, it can be complicated to get everything set up.
Solution
This code is ported from https://github.com/TimJentzsch/cargo-bavy, but cleaned up, with more docs, and sometimes adjusted to improve the functionality.
For the most part,
bevy build
andbevy run
are wrappers around thecargo
counterparts.However, we add an additional
--web
flag, which simplifies the process of building and running web apps.Currently it:
Assets are served automatically from the
assets
folder.Missing targets and CLI tools are installed automatically (if confirmed by the user).
TODO
target
folder, so it's cleaned up properly and doesn't require an additional gitignore.index.html
file if none is defined, making theweb
folder fully optional.cargo
(can be stacked).