Crates.io | dors |
lib.rs | dors |
version | 0.0.8 |
source | src |
created_at | 2020-03-29 18:25:49.753031 |
updated_at | 2020-06-05 23:19:58.027114 |
description | No-fuss workspace-friendly task runner for cargo |
homepage | |
repository | https://github.com/aklitzke/dors |
max_upload_size | |
id | 224156 |
size | 57,376 |
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
[task.do-tests]
command = "cargo test --target x86_86-unknown-linux-gnu -- --nocapture"
$ dors do-tests
$ cargo install dors
# ./Dorsfile.toml
[task.test]
command = "echo Hello, World! from $PWD"
run-from = "members"
# ./member-1/Dorsfile
[[env]]
CARGO_TARGET_DIR = "../target-member-1"
Dors will automatically assign CARGO_WORKSPACE_ROOT
for you. $PWD
, $HOME
, and other
environment variables work as expected.
[[env]]
MY_SPECIAL_ENV_VAR = "$(ls)"
ANOTHER_ENV_VAR = "$HOME/.cargo/bin"
$ cargo dors -l
my-special-task
load
deploy
Also supports tab autocompletion of tasks!
[task.say-hi]
command = 'echo Hello, "$@"!'
$ cargo dors say-hi -- Fellow Human
Hello, Fellow Human!
# ./Dorsfile.toml
[task.play-go]
command = '''
url="igs.joyjoy.net 6969"
telnet $url
'''
# ./Dorsfile.toml
[task.check]
command = "cargo check --all-targets"
$ cd shared_code && cargo dors check
#./Dorsfile.toml
[task.play-go]
before = ["install-telnet"]
command = "telnet igs.joyjoy.net 6969"
after = ["congratulate"]
[task.install-telnet]
command = "sudo apt-get install -y --no-install-recommends telnet"
[task.congratulate]
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.
#./Dorsfile.toml
[task.build]
command = "cargo build"
run-from = "members"
#./embedded_device/Dorsfile.toml
[task.build]
command = "cargo build --features debug-logs"
#./Dorsfile.toml
[task.test]
command = "cargo test"
run-from = "members"
skip-members = ["embedded_device"]
[task.clippy]
command = "cargo clippy"
run-from = "members"
only-members = ["shared_code"]
# ./embedded_device/Dorsfile.toml
[task.pre-build]
run-from = "workspace-root"
command = "echo interestingstuff > target/special-file"
# ./Dorsfile.toml
[task.run-other-project]
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!