tomsik68 / rust-minimono

Sample layout for a Rust mini monorepo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust Minimono

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:

  1. Showcase that many things can be put together to form a meaningful whole.
  2. Configure some widely-used helpful Rust tools.
  3. Help the "Rustification" of build scripts by incorporating nice xtask jobs.
  4. Make it very easy to onboard new collaborators.

Non-goals:

  1. Prescribe that your company uses monorepo. Please use whatever floats your boat.

Pre-configured tools

  • deny: lint dependencies
  • taplo: format Cargo.toml files
  • wipe: wipe target folder
  • msrv: find actual MSRV for project

top-level directories

crates

Library Rust projects.

xtask

Implementation of xtask jobs.

First-time setup

Installing rustup

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.

Idempotent

cargo xtask ensure-installed

Note that if you're running this for the first time, rustup automatically downloads 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.

Other available tasks

Please run the following command to get an overview:

cargo xtask help

About

Sample layout for a Rust mini monorepo

License:MIT License


Languages

Language:Rust 100.0%