7 releases

✓ Uses Rust 2018 edition

0.0.7 May 22, 2020
0.0.6 Apr 11, 2020
0.0.5 Mar 31, 2020

#43 in Build Utils

Download history 121/week @ 2020-03-27 2/week @ 2020-04-03 84/week @ 2020-04-10 12/week @ 2020-04-17 9/week @ 2020-04-24 2/week @ 2020-05-01 18/week @ 2020-05-08 2/week @ 2020-05-15 37/week @ 2020-05-22

88 downloads per month

MIT/Apache and MPL-2.0 licenses

685 lines

🌈 Dors more, with Dorsfiles 🌂

crates.io Build Status

What is this?

A task runner for the rust and cargo ecosystem.

Especially targeted toward environments with a large cargo workspace, like embedded or cloud-based, that often contain multiple targets, tools outside of the rust ecosystem, complex deploy scripts, and CI pipelines.

Designed with the hope that easy things will be easy, and hard things will be possible.


# ./Dorsfile.toml
command = "cargo test --target x86_86-unknown-linux-gnu -- --nocapture"
$ cargo dors do-tests


$ cargo install dors


Run tasks on all members of a workspace:

# ./Dorsfile.toml
command = "echo Hello, World! from $PWD"
run-from = "members"

Set crate-specific environment variables:

# ./member-1/Dorsfile
CARGO_TARGET_DIR = "../target-member-1"

Dors will automatically assign CARGO_WORKSPACE_ROOT for you. $PWD, $HOME, and other environment variables work as expected.

Assign environment variables with bash:

ANOTHER_ENV_VAR = "$HOME/.cargo/bin"

View all available tasks:

$ cargo dors -l

Also supports tab autocompletion of tasks!

Pass arguments:

command = 'echo Hello, "$@"!'
$ cargo dors say-hi -- Fellow Human
Hello, Fellow Human!

Run multi-line bash scripts:

# ./Dorsfile.toml
command = '''
url="igs.joyjoy.net 6969"
telnet $url

Reduce duplication by inheriting tasks:

# ./Dorsfile.toml
command = "cargo check --all-targets"
$ cd shared_code && cargo dors check

Invoke tasks before or after others:

before = ["install-telnet"]
command = "telnet igs.joyjoy.net 6969"
after = ["congratulate"]

command = "sudo apt-get install -y --no-install-recommends telnet"

command = "echo 'I hope you played well!'"

Before/after tasks are ran from left to right. If a task is repeated in the tree, it will only be ran once.

Override workspace tasks for a single workspace member:

command = "cargo build"
run-from = "members"
command = "cargo build --features debug-logs"

Skip particular members:

command = "cargo test"
run-from = "members"
skip-members = ["embedded_device"]

command = "cargo clippy"
run-from = "members"
only-members = ["shared_code"]

Run commands from member crate on workspace root:

# ./embedded_device/Dorsfile.toml
run-from = "workspace-root"
command = "echo interestingstuff > target/special-file"

Run commands from arbitrary paths:

# ./Dorsfile.toml
run-from = { path = "../random_node_project" }
command = "npm run"

...And more! 🎩


Q: Will this automatically provide me with standard cargo commands?
A: Nope. A blank Dorsfile is a blank Dorsfile. It's up to you to build it out.

Q: Is this ready for production?
A: This is currently in alpha. Use at your own risk.

Q: How do you pronounce this?
A: Like 'horse'

Q: Shouldn't you just add an 'e' at the end? Like 'dorse'?
A: Never. Nope. Go to your room. Don't come out till you've learned your lesson 🙃

Q: Do I have to use this with a workspace?
A: You can use this crate with or without your crate being a workspace.

Q: What are the next steps for improvement?
A: Likely error messaging. Want something? Open an issue!

Q: Would you accept a PR?
A: Absolutely!

Q: My question wasn't answered here
A: Feel free to reach out!

An open book


~59K SLoC