[package]
name = "dev-tools"
version = "0.9.7"
edition = "2021"
rust-version = "1.85"
readme = "README.md"
license = "Apache-2.0"

authors = [
    "James Gober <me@jamesgober.com>"
]

description = "Rust verification toolkit. Tests, benches, coverage, fuzz, security audit, dep hygiene, mutation, chaos, async, stress — one crate, opt in with feature flags."

keywords = [
    "testing",
    "benchmark",
    "coverage",
    "fuzz",
    "audit"
]

categories = [
    "development-tools",
    "development-tools::testing",
    "development-tools::profiling"
]

documentation = "https://docs.rs/dev-tools"
repository = "https://github.com/jamesgober/dev-tools"
homepage = "https://github.com/jamesgober/dev-tools"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
# Core: report schema is required for the umbrella to make sense.
# `^0.9` SemVer requirement matches any 0.9.x — keeps dev-tools
# decoupled from coordinated patch releases of the sibling crates.
dev-report = { version = "0.9", path = "../dev-report" }

# Used by `producers` (cargo JSON message parsing) and the HTML
# meta-report. Already in the transitive tree via dev-report; declared
# directly here so dev-tools doesn't rely on dev-report's internals.
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# Pulled in by the `cli` feature for the `dev` binary. Library
# consumers don't pay for clap's compile time unless they opt in.
clap = { version = "4", features = ["derive"], optional = true }

# Optional sub-crates pulled in by feature flags.
dev-fixtures = { version = "0.9", path = "../dev-fixtures", optional = true }
dev-bench    = { version = "0.9", path = "../dev-bench",    optional = true }
dev-async    = { version = "0.9", path = "../dev-async",    optional = true }
dev-stress   = { version = "0.9", path = "../dev-stress",   optional = true }
dev-chaos    = { version = "0.9", path = "../dev-chaos",    optional = true }

# Added in v0.9.4. Each one is independently opt-in; `full` pulls in
# everything.
dev-coverage = { version = "0.9", path = "../dev-coverage", optional = true }
dev-security = { version = "0.9", path = "../dev-security", optional = true }
dev-deps     = { version = "0.9", path = "../dev-deps",     optional = true }
dev-ci       = { version = "0.9", path = "../dev-ci",       optional = true }
dev-fuzz     = { version = "0.9", path = "../dev-fuzz",     optional = true }
dev-flaky    = { version = "0.9", path = "../dev-flaky",    optional = true }
dev-mutate   = { version = "0.9", path = "../dev-mutate",   optional = true }

[dev-dependencies]
# Used by html-module tests to construct frozen timestamps so HTML
# output is byte-deterministic in the test suite. Available transitively
# through dev-report; declared directly here for the test scope.
chrono = { version = "0.4", default-features = false, features = ["clock"] }

[features]
# Sensible default for most projects: temp environments, perf checks,
# and the report schema.
default = ["fixtures", "bench"]

# All sub-crates.
full = [
    "fixtures", "bench", "async", "stress", "chaos",
    "coverage", "security", "deps", "ci", "fuzz", "flaky", "mutate",
]

# Per-crate feature flags.
fixtures = ["dep:dev-fixtures"]
bench    = ["dep:dev-bench"]
async    = ["dep:dev-async"]
stress   = ["dep:dev-stress"]
chaos    = ["dep:dev-chaos"]
coverage = ["dep:dev-coverage"]
security = ["dep:dev-security"]
deps     = ["dep:dev-deps"]
ci       = ["dep:dev-ci"]
fuzz     = ["dep:dev-fuzz"]
flaky    = ["dep:dev-flaky"]
mutate   = ["dep:dev-mutate"]

# Builds the `dev` CLI binary. Pulls in every sub-crate plus clap so
# a single `cargo install dev-tools --features cli` gets users every
# verification dimension as a subcommand. The `dev-report/*` entries
# enable the renderer features on the upstream crate so `dev report
# --format markdown|sarif|junit|terminal` all work.
cli = [
    "dep:clap",
    "coverage", "security", "deps", "ci",
    "fuzz", "flaky", "mutate", "bench",
    "dev-report/terminal",
    "dev-report/markdown",
    "dev-report/sarif",
    "dev-report/junit",
]

# The `dev` CLI binary. Gated behind `cli` so library consumers
# (`cargo add dev-tools` without --features) don't pay for clap's
# compile time. `cargo install dev-tools --features cli` builds it.
[[bin]]
name = "dev"
path = "src/bin/dev.rs"
required-features = ["cli"]

# Examples gated by the corresponding feature flag. `cargo build --examples`
# (default features) builds only the always-available ones; turning on a
# feature pulls in the matching example automatically.
[[example]]
name = "coverage_basic"
required-features = ["coverage"]

[[example]]
name = "security_basic"
required-features = ["security"]

[[example]]
name = "deps_basic"
required-features = ["deps"]

[[example]]
name = "ci_generate"
required-features = ["ci"]

[[example]]
name = "fuzz_basic"
required-features = ["fuzz"]

[[example]]
name = "flaky_basic"
required-features = ["flaky"]

[[example]]
name = "mutate_basic"
required-features = ["mutate"]

[[example]]
name = "full_pipeline"
required-features = ["coverage", "security", "flaky", "mutate"]

[profile.release]
opt-level = 3
lto = "thin"
