This is an example repository for cargo xtask
.
For more information on @matklad's cargo xtask
pattern, visit the original repository.
In the root of the repository, run the following command:
cargo xtask
A list of "tasks" should print alongside their descriptions. This command works via an alias in the repository's cargo configuration file.
This repository contains two crates: xtask
and your-crate
.
The former contains the "tasks" and ability to run them.
The latter represents the crate(s) that xtask
would help orchestrate "tasks" for.
.
├── .cargo
│ └── config
│
├── Cargo.lock
├── Cargo.toml
│
├── README.md
│
└── crates
│
├── xtask
│ ├── Cargo.toml
│ └── src
│
└── your-crate
├── Cargo.toml
└── src
Using external build systems and scripting languages can be useful, but using these technologies can result in inaccessible contributing experiences and potentially locking out valid development environments.
Since cargo
is the tried and true build system for Rust (tested on multiple tiered targets), we can get the best of both worlds by using a small wrapper around it.
Thus, cargo xtask
exists to fill the gap; allowing for repository automation without needing to install another dependency.