cargo_ark/lib.rs
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))]
5
6//! Validates Rust release candidates by testing their packaged archives.
7//!
8//! Use [`release_dependencies::Candidates`] to parse a candidate report and
9//! [`release_dependencies::CargoInvoker`] to prepare Cargo, then pass both to
10//! [`release_dependencies::check`].
11//!
12//! For command-line usage, see the [CLI guide].
13//!
14//! # Example
15//!
16//! Check a candidate from the workspace root using the caller's toolchain:
17//!
18//! ```no_run
19//! use cargo_ark::release_dependencies::{Candidates, CargoInvoker, check};
20//!
21//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
22//! let candidates = Candidates::from_report(r#"[{"name":"my-crate","new_version":"1.2.0"}]"#)?;
23//! let cargo = CargoInvoker::new(std::path::Path::new("."), Default::default(), None)?;
24//! check(candidates, cargo)?;
25//! # Ok(())
26//! # }
27//! ```
28//!
29//! [CLI guide]: https://github.com/microsoft/ox-tools/blob/main/crates/cargo-ark/docs/cli.md
30
31pub mod release_dependencies;