| Crates.io | strl1-xtaskops |
| lib.rs | strl1-xtaskops |
| version | 0.7.1 |
| created_at | 2025-10-20 12:50:41.463177+00 |
| updated_at | 2025-12-20 12:31:57.730976+00 |
| description | Goodies for working with the xtask concept |
| homepage | |
| repository | https://github.com/strangelightstudios/strl1.git |
| max_upload_size | |
| id | 1891870 |
| size | 159,297 |
[!CAUTION] The content of this repository is publicly accessible; do not add secret or sensitive information.
This is a Rust library that has a few goodies for working with the xtask concept.
[dependencies]
xtaskops = "0.5.0"
For most recent version see crates.io
You should have the xtask concept already set up for your project.
You can include everything from xtask in your project. In your xtask/main.rs:
fn main() -> Result<(), anyhow::Error> {
xtaskops::tasks::main()
}
xtaskops supports workspace-specific configuration via a .xtask.toml file. When you run any xtask command, it will automatically search for this file starting from the current directory and walking up the directory tree.
Copy the example configuration:
cp .xtask.example.toml .xtask.toml
Then customize it for your workspace:
# Workspace name
workspace_name = "my-project"
# Package names for different tasks
main_package = "my-cli"
controlplane_package = "my-server"
[aws]
region = "us-west-2"
account_id = "123456789012"
ecr_registry = "123456789012.dkr.ecr.us-west-2.amazonaws.com"
sso_start_url = "https://my-company.awsapps.com/start"
sso_region = "us-west-2"
sso_role_name = "AdministratorAccess"
Without config, you would need:
cargo xtask dist --registry 123456789012.dkr.ecr.us-west-2.amazonaws.com --region us-west-2
With .xtask.toml, you can simply run:
cargo xtask dist
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(())
Run:
$ cargo xtask coverage
Recommended: alias cargo xtask to x:
# in your zshrc/shell rcfile
alias x="cargo xtask"
See LICENSE for further details.