This repository shows a possible layout of a Rust mini-monorepo.
This layout is a welcoming environment for all the things - libraries, binaries and even build tasks!
Goals of this:
- Showcase that many things can be put together to form a meaningful whole.
- Configure some widely-used helpful Rust tools.
- Help the "Rustification" of build scripts by incorporating nice xtask jobs.
- Make it very easy to onboard new collaborators.
Non-goals:
- Prescribe that your company uses monorepo. Please use whatever floats your boat.
- deny: lint dependencies
- taplo: format Cargo.toml files
- wipe: wipe target folder
- msrv: find actual MSRV for project
Rust Crates that are part of this repository.
You can use cargo xt new
to create a new crate in this repository.
Implementation of xtask jobs.
Rustup is a tool that manages different versions of Rust toolchain on your system. Let's install that first by running the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
For alternative installation options, please refer to rustup.rs
There's no need to re-run this command - rustup remains installed on your machine.
cargo xtask ensure-installed
Note that rustup ensures you're using the right version of Rust as declared in rust-toolchain.toml.
This command may need to be re-run in case someone adds new tools to the set. The neat part is that re-running makes sure your environment is up-to-date.
Please run the following command to get an overview:
cargo xtask help
You can use a shell alias! Most shells will be okay with:
alias cx='cargo xt'