[tasks.cli]
description = "Run a CLI command"
quiet = true
run = "cargo run --no-default-features --features cli"

[tasks.docs]
description = "Build and serve docs"
run = "mdbook serve docs/"

[tasks.favicon]
description = "Generate favicon for the site from the logo image"
run = "magick -background transparent $MISE_PROJECT_ROOT/static/slumber.png -define icon:auto-resize=64 $MISE_PROJECT_ROOT/docs/theme/favicon.png"
sources = ["docs/theme/favicon.png"]

[tasks.mdbook]
# .rs scripts don't support #MISE headers so task metadata is defined here
description = "Generate doc content from Rust code"

[tasks.test]
description = "Run tests"
run = "cargo test"

[tasks.tui-profile]
description = "Run the TUI with samply for profiling"
env.CARGO_PROFILE_RELEASE_DEBUG = true # Include debug symbols
env.SLUMBER_DATA_DIRECTORY = "{{ env.PWD }}/data/" # Use local config/data dir
run = [
    "cargo build --no-default-features --features=tui --bin=slumber --release",
    "samply record ./target/release/slumber",
]
tools."cargo:samply" = "0.13.1"

[env]
RUST_BACKTRACE = "1"

[tools]
mdbook = "0.5.1"
