1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-05-22 02:10:25 +02:00
Eric Githinji 738d5ad820
Simplify project commands using cargo xtask (#2753)
We are already using `cargo xtask install-tools` to install the
project's tools, and `cargo xtask web-tests` to run the js tests. In
this PR we provide support for the various `mdbook` commands
(`test`,`serve`, and `build`) with `cargo xtask` commands. This provides
a uniform interface for running tasks in the project. Additionally it
allows these commands to work from within any dirrectory (previously
you'd need to navigate to the workspace root in order to run say `mdbook
build`).

Additionally we're improving the xtask code by making use of `Clap`
enums to handle validation of the possible tasks to run via xtask (this
closes #2741 ).

---------

Co-authored-by: Eric Githinji <egithinji@google.com>
2025-05-21 09:58:52 +03:00
..
2025-04-07 12:18:49 +02:00

xtask

The purpose of the xtask binary is to enable cross platform task automation within the project (somewhat similar to how npm run is used in Node.js projects to run scripts). Please see cargo xtask for more information.

To add support for a new task, add a new arm to the match in the execute_task function, and add a new handler function that contains the logic.