8 unstable releases (3 breaking)

0.4.2 May 4, 2023
0.4.1 Dec 25, 2022
0.3.0 Nov 29, 2022
0.2.2 Nov 11, 2022
0.1.0 Aug 9, 2022

#606 in Development tools

Download history 566/week @ 2024-03-13 600/week @ 2024-03-20 471/week @ 2024-03-27 481/week @ 2024-04-03 679/week @ 2024-04-10 369/week @ 2024-04-17 850/week @ 2024-04-24 861/week @ 2024-05-01 618/week @ 2024-05-08 548/week @ 2024-05-15 407/week @ 2024-05-22 562/week @ 2024-05-29 667/week @ 2024-06-05 470/week @ 2024-06-12 244/week @ 2024-06-19 269/week @ 2024-06-26

1,784 downloads per month
Used in lintd-taskops

Apache-2.0

15KB
275 lines

xtaskops

github crates.io docs.rs build status

This is a Rust library that has a few goodies for working with the xtask concept.

Dependency

[dependencies]
xtaskops = "0.4.0"

For most recent version see crates.io

Usage

You should have the xtask concept already set up for your project.

Available Tasks

Full workflow tasks for your daily development.

  • bloat_deps Show biggest crates in release build
  • bloat_time Show crate build times
  • dev Run cargo check followed by cargo test for every file change
  • ci Run typical CI tasks in series: fmt, clippy, and tests
  • coverage Run coverage
  • docs Run cargo docs in watch mode
  • install Instal cargo tools
  • powerset Perform a CI build with powerset of features

Here's an example for how to integrate the coverage task with clap:

use xtaskops::tasks;
// assuming you use `clap`
let res = match matches.subcommand() {
    Some(("coverage", sm)) => tasks::coverage(sm.is_present("dev")),
  //..

Quick start

You can include everything from xtask in your project. In your xtask/main.rs:

fn main() -> Result<(), anyhow::Error> {
    xtaskops::tasks::main()
}

Ops

Low level convenience operations, for file system operations, user input and more.

use xtaskops::ops::{remove_dir, create_dir_all, cmd};

remove_dir("target")?;
create_dir_all("target")?;
// cmd! is from the `duct` library
cmd!("cargo", "watch", "-s", "cargo doc --no-deps").run()?;
Ok(())

Running Tasks

Run:

$ cargo xtask coverage

Recommended: alias cargo xtask to x:

# in your zshrc/shell rcfile
alias x="cargo xtask"

Copyright

Copyright (c) 2022 @jondot. See LICENSE for further details.

Dependencies

~4–12MB
~127K SLoC