use const_format::{formatcp, str_index};
#[cfg(debug_assertions)]
const BUILD_TYPE: &str = "debug";
#[cfg(not(debug_assertions))]
const BUILD_TYPE: &'static str = "release";
const GIT_BRANCH: &str = match option_env!("GITHUB_REF_NAME") {
Some(v) => v,
None => "unknown",
};
const GIT_COMMIT: &str = match option_env!("GITHUB_SHA") {
Some(v) => v,
None => "unknown",
};
pub(super) const VERSION_MESSAGE: &str = formatcp!(
r#"
Version {}
Profile {}
Commit {} on branch {}
Target {}
Repository {}
Authors {}"#,
env!("CARGO_PKG_VERSION"),
BUILD_TYPE,
str_index!(GIT_COMMIT, 0..7),
GIT_BRANCH,
current_platform::CURRENT_PLATFORM,
env!("CARGO_PKG_REPOSITORY"),
env!("CARGO_PKG_AUTHORS"),
);