Skip to main content

provenant/
version.rs

1use std::sync::OnceLock;
2
3pub const BUILD_VERSION: &str = match option_env!("PROVENANT_BUILD_VERSION") {
4    Some(version) => version,
5    None => env!("CARGO_PKG_VERSION"),
6};
7
8const ATTRIBUTION_NOTICE: &str = "License detection uses data from ScanCode Toolkit (CC-BY-4.0). See NOTICE file or --show-attribution option.";
9
10pub fn build_long_version() -> &'static str {
11    static LONG_VERSION: OnceLock<String> = OnceLock::new();
12
13    LONG_VERSION
14        .get_or_init(|| format!("{BUILD_VERSION}\n{ATTRIBUTION_NOTICE}"))
15        .as_str()
16}