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
parent e1655edd83
commit a98da7d942
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
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})"))
}