build_rs/
lib.rs

1//! build-rs provides a strongly typed interface around the Cargo build script
2//! protocol. Cargo provides inputs to the build script by environment variable
3//! and accepts commands by printing to stdout.
4//!
5//! > This crate is maintained by the Cargo team for use by the wider
6//! > ecosystem. This crate follows semver compatibility for its APIs.
7#![cfg_attr(all(doc, feature = "unstable"), feature(doc_auto_cfg, doc_cfg))]
8#![allow(clippy::disallowed_methods)] // HACK: deferred resoling this
9#![allow(clippy::print_stdout)] // HACK: deferred resoling this
10
11#[cfg(feature = "unstable")]
12macro_rules! unstable {
13    ($feature:ident, $issue:literal) => {
14        concat!(
15            r#"<div class="stab unstable">"#,
16            r#"<span class="emoji">🔬</span>"#,
17            r#"<span>This is a nightly-only experimental API. (<code>"#,
18            stringify!($feature),
19            r#"</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/"#,
20            $issue,
21            r#"">#"#,
22            $issue,
23            r#"</a>)</span>"#,
24            r#"</div>"#
25        )
26    };
27}
28
29macro_rules! respected_msrv {
30    ($ver:literal) => {
31        concat!(
32            r#"<div class="warning">
33
34MSRV: Respected as of "#,
35            $ver,
36            r#".
37
38</div>"#
39        )
40    };
41}
42
43macro_rules! requires_msrv {
44    ($ver:literal) => {
45        concat!(
46            r#"<div class="warning">
47
48MSRV: Requires "#,
49            $ver,
50            r#".
51
52</div>"#
53        )
54    };
55}
56
57mod ident;
58
59pub mod input;
60pub mod output;