69 lines
2.5 KiB
Rust
69 lines
2.5 KiB
Rust
//! Cargo-native workflow entrypoints for `aria2-rust-pro`.
|
|
#![expect(
|
|
unreachable_pub,
|
|
clippy::indexing_slicing,
|
|
clippy::integer_division,
|
|
clippy::large_stack_arrays,
|
|
clippy::redundant_pub_crate,
|
|
clippy::too_many_lines,
|
|
reason = "xtask is an internal workflow binary; product-facing runtime crates keep the stricter public-surface and implementation discipline"
|
|
)]
|
|
|
|
/// `clap` command-line model for the cargo-native workflow entrypoint.
|
|
mod cli;
|
|
/// Compatibility-oriented maintenance workflows.
|
|
mod compat;
|
|
/// Local Docker export and smoke workflows.
|
|
mod docker;
|
|
/// Performance collection and same-host comparison workflows.
|
|
mod perf;
|
|
/// Release packaging and version-smoke workflows.
|
|
mod release;
|
|
/// Strict local quality-sweep workflows.
|
|
mod testing;
|
|
/// Shared workspace discovery and command helpers.
|
|
mod workspace;
|
|
|
|
use anyhow::Result;
|
|
use clap::Parser;
|
|
|
|
use crate::cli::{
|
|
Cli, CompatSubcommand, DockerSubcommand, PerfSubcommand, ReleaseSubcommand, TestingSubcommand,
|
|
TopLevelCommand,
|
|
};
|
|
|
|
/// Runs the `xtask` entrypoint and converts structured failures into a non-zero exit code.
|
|
fn main() {
|
|
if let Err(error) = run() {
|
|
eprintln!("{error:#}");
|
|
std::process::exit(1);
|
|
}
|
|
}
|
|
|
|
/// Dispatches the requested top-level `xtask` workflow.
|
|
fn run() -> Result<()> {
|
|
let cli = Cli::parse();
|
|
match cli.command {
|
|
TopLevelCommand::Compat(command) => match command.command {
|
|
CompatSubcommand::CaptureCliGoldens(args) => compat::run_capture_cli_goldens(&args),
|
|
},
|
|
TopLevelCommand::Docker(command) => match command.command {
|
|
DockerSubcommand::ExportLocal(args) => docker::run_export_local(&args),
|
|
DockerSubcommand::Smoke(args) => docker::run_smoke(&args),
|
|
DockerSubcommand::SmokeLocal(args) => docker::run_smoke_local(&args),
|
|
},
|
|
TopLevelCommand::Perf(command) => match command.command {
|
|
PerfSubcommand::CollectLocalComparison(args) => {
|
|
perf::run_collect_local_comparison(&args)
|
|
}
|
|
},
|
|
TopLevelCommand::Release(command) => match command.command {
|
|
ReleaseSubcommand::SmokeVersion(args) => release::run_release_smoke_version(&args),
|
|
ReleaseSubcommand::PackageLocal(args) => release::run_package_local(&args),
|
|
},
|
|
TopLevelCommand::Testing(command) => match command.command {
|
|
TestingSubcommand::StrictSweep(args) => testing::run_strict_sweep(&args),
|
|
},
|
|
}
|
|
}
|