74 lines
3.7 KiB
TOML
74 lines
3.7 KiB
TOML
[workspace]
|
|
name = "coursebank"
|
|
version = "0.0.0"
|
|
authors = ["Scientific Computing Studio <opensource@scient.ing>"]
|
|
channels = ["conda-forge"]
|
|
platforms = ["linux-64", "osx-arm64", "osx-64"]
|
|
|
|
[dependencies]
|
|
rust = ">=1.96.0,<1.97"
|
|
c-compiler = "*"
|
|
pkg-config = "*"
|
|
|
|
|
|
[tasks]
|
|
|
|
# --- Build and run ---
|
|
build = { cmd = "cargo build --release", description = "Compile the release binary at target/release/coursebank" }
|
|
debug = { cmd = "cargo build", description = "Compile the debug binary" }
|
|
build-lean = { cmd = "cargo build --release --no-default-features", description = "Release build without the parquet feature" }
|
|
install = { cmd = "cargo install --path . --locked", description = "Install the coursebank binary onto your PATH" }
|
|
clean = { cmd = "cargo clean", description = "Remove the target directory" }
|
|
cb = { cmd = "cargo run --release --quiet --", description = "Run the CLI, e.g., `pixi run cb validate -C path/to/course`" }
|
|
|
|
# --- Quality gate ---
|
|
format = { cmd = "cargo fmt --all", description = "Reformat the source in place" }
|
|
fmt-check = { cmd = "cargo fmt --all --check", description = "Fail if the source is not formatted; does not rewrite" }
|
|
lint = { cmd = "cargo clippy --all-targets -- -D warnings", description = "Run clippy with warnings treated as errors" }
|
|
tests = { cmd = "cargo test", description = "Run all tests: unit, integration, and doctests" }
|
|
doctests = { cmd = "cargo test --doc", description = "Run only the documentation examples" }
|
|
check-docs = { cmd = "cargo test --test docs", description = "Check that included markdown fences declare a language" }
|
|
check = { depends-on = ["fmt-check", "lint", "tests", "doctests", "check-docs", "doc-build"], description = "Full verify-only gate: formatting, lint, tests, and doc build" }
|
|
|
|
# --- Documentation ---
|
|
doc = { cmd = "cargo doc --no-deps --open", depends-on = ["check-docs"], description = "Build the API docs and open them in a browser" }
|
|
doc-build = { cmd = "cargo doc --no-deps", depends-on = ["check-docs"], description = "Build the API docs without opening a browser" }
|
|
|
|
# --- Release packaging ---
|
|
setup-tools = { cmd = "cargo install cargo-about --locked --features cli", description = "Install cargo-about, which the licenses task needs" }
|
|
licenses = { cmd = "cargo about generate about.hbs -o THIRD-PARTY-LICENSES.txt", description = "Regenerate THIRD-PARTY-LICENSES.txt" }
|
|
dist = { cmd = "mkdir -p dist && cp target/release/coursebank dist/ && cp LICENSE.md THIRD-PARTY-LICENSES.txt dist/", depends-on = ["build", "licenses"], description = "Assemble a release bundle (binary and license notices) in dist/" }
|
|
|
|
[environments]
|
|
dev = ["dev"]
|
|
docs = ["docs"]
|
|
release = ["release"]
|
|
|
|
# Developer tooling: editor support, a debugger, a faster test runner, and a
|
|
# file watcher.
|
|
[feature.dev.dependencies]
|
|
rust-analyzer = "*"
|
|
lldb = "*"
|
|
cargo-nextest = "*"
|
|
|
|
[feature.dev.tasks]
|
|
nextest = { cmd = "cargo nextest run", description = "Run the test suite with nextest" }
|
|
|
|
# Typst is only needed to typeset exported .typ files by hand. The exporter
|
|
# writes .typ on its own and does not require typst to be installed.
|
|
[feature.docs.dependencies]
|
|
typst = "*"
|
|
|
|
[feature.docs.tasks]
|
|
typeset = { cmd = "typst compile", description = "Compile a .typ file to PDF" }
|
|
|
|
# Release tooling, kept in its own environment so the default and dev
|
|
# environments do not pull in Python. bump-my-version reads .bumpversion.toml,
|
|
# which encodes the YY.MM.PATCH scheme.
|
|
[feature.release.dependencies]
|
|
bump-my-version = "*"
|
|
|
|
[feature.release.tasks]
|
|
bump = { cmd = "bump-my-version bump patch", description = "Cut the next release: rewrite the version in both manifests, commit, and tag" }
|
|
bump-show = { cmd = "bump-my-version show-bump", description = "Preview the next version without changing anything" }
|