1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-04 13:50:28 +02:00
### Background
Comprehensive Rust requires a number of tools to be installed (e.g.
mdbook and mdbook-course). As mentioned in #2509 (and discussed in
#2469) it would be nice to have a cross platform command for installing
these dependencies. Currently these are installed using a shell script
(`install-mdbook.sh`) but this isn't truly cross platform e.g. for
Windows users.

### Xtask

[xtask](https://github.com/matklad/cargo-xtask) outlines an approach for
automating tasks in a Rust project. It involves using cargo's aliasing
feature to allow us to run commands like `cargo xtask <some task>` to
perform adhoc tasks via a Rust binary that we might otherwise need a
shell script for.

In this PR we add support for a `cargo xtask install-tools` command that
will replace the `install-mdbook.sh` script and install the dependent
tools. We can potentially extend it to support for other tasks e.g.
`cargo xtask fmt`.

---------

Co-authored-by: Eric Githinji <egithinji@google.com>
This commit is contained in:
Eric Githinji
2025-03-14 14:24:08 +03:00
committed by GitHub
parent 01176e0de0
commit 91f6de64df
8 changed files with 84 additions and 13 deletions

View File

@ -6,7 +6,7 @@ runs:
using: composite
steps:
- name: Install mdbook
run: ./install-mdbook.sh
run: cargo xtask install-tools
shell: bash
- name: Install dependencies for mdbook-pandoc