refactor: Move git version info gather in into a build script

This commit is contained in:
Jade Ellis 2025-05-01 00:38:35 +01:00 committed by magmaus3
parent 8cb5013043
commit 2c8ae23d93
Signed by: magmaus3
GPG key ID: C8AABFABFA2FAF66
14 changed files with 231 additions and 123 deletions

View file

@ -67,6 +67,7 @@ checked_ops.workspace = true
chrono.workspace = true
clap.workspace = true
conduwuit-macros.workspace = true
conduwuit-build-metadata.workspace = true
const-str.workspace = true
core_affinity.workspace = true
ctor.workspace = true

View file

@ -26,13 +26,6 @@ pub fn user_agent() -> &'static str { USER_AGENT.get_or_init(init_user_agent) }
fn init_user_agent() -> String { format!("{}/{}", name(), version()) }
fn init_version() -> String {
option_env!("CONDUWUIT_VERSION_EXTRA")
.or(option_env!("CONDUIT_VERSION_EXTRA"))
.map_or(SEMANTIC.to_owned(), |extra| {
if extra.is_empty() {
SEMANTIC.to_owned()
} else {
format!("{SEMANTIC} ({extra})")
}
})
conduwuit_build_metadata::VERSION_EXTRA
.map_or(SEMANTIC.to_owned(), |extra| format!("{SEMANTIC} ({extra})"))
}