shadow-formatted-version 1.1.1

Version information in a preformatted block
Documentation
#![allow(clippy::needless_doctest_main)] //needed to describe build.rs in README.md
#![doc = include_str!("../README.md")]

/// Generates a constant containing a preformatted version string.
///
/// Use this together with [shadow-rs](https://crates.io/crates/shadow-rs), by placing the following into your `main.rs` or `lib.rs`:
/// ```text
/// shadow_rs::shadow!(build);
/// shadow_formatted_version::from_shadow!(build);
/// ```
/// The name "build" is of the module that shadow-rs generates. You can choose a different name, if you prefer.
#[macro_export]
macro_rules! from_shadow {
    ($shadow_module:ident) => {
        /// Detailed crate version information in a preformatted block.
        ///
        /// It looks like this, for example:
        /// ```text
        ///   Version:       0.1.0
        ///   Target:        x86_64-unknown-linux-gnu
        ///   Commit:        8f29a49b54ca3e94070d244511d8e4a64a69f083
        ///   Commit-Date:   2023-12-31 23:59:59 +00:00
        ///   Build-Date:    2024-12-31 23:59:59 +00:00
        ///   Build-Clean:   No uncommitted changes in build.
        ///   Rust-Version:  rustc 1.76.0 (07dca489a 2024-02-04)
        /// ```
        ///
        /// See [shadow_formatted_version](https://crates.io/crates/shadow-formatted-version) for more information.
        pub(crate) const FORMATTED_VERSION: &'static str =
            shadow_rs::formatcp!(
"
  Version:       {crate_version}
  Target:        {build_target}
  Commit:        {commit}
  Commit-Date:   {commit_date}
  Build-Date:    {build_date}
  Build-Clean:   {build_clean}
  Rust-Version:  {rust_version}
",
            crate_version = $shadow_module::PKG_VERSION,
            build_target = $shadow_module::BUILD_TARGET,
            commit = $shadow_module::COMMIT_HASH,
            commit_date = $shadow_module::COMMIT_DATE,
            build_date = $shadow_module::BUILD_TIME,
            build_clean = if $shadow_module::GIT_CLEAN {
                "No uncommitted changes in build."
            } else {
                "Distribution was built with uncommitted changes! Commit does not reflect actual application code!"
            },
            rust_version = $shadow_module::RUST_VERSION,

        );
    }
}