-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
30 lines (27 loc) · 862 Bytes
/
Copy pathbuild.rs
File metadata and controls
30 lines (27 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::env;
use build_data::get_git_dirty;
/// Outputs a readable version number such as
/// 0.4.0 (if git commit is clean)
/// 0.4.0-SNAPSHOT (if git commit is dirty, should not happen in CI/CD builds)
fn version() -> String {
let version = String::from(env!("CARGO_PKG_VERSION"));
match get_git_dirty().unwrap() {
false => version,
true => {
format!("{}-SNAPSHOT", version)
}
}
}
fn main() {
build_data::set_GIT_COMMIT_SHORT();
build_data::set_GIT_DIRTY();
build_data::set_BUILD_DATE();
build_data::set_BUILD_TIME();
// We must always run this build script as otherwise, we would cache old versions of CQL maps
//build_data::no_debug_rebuilds();
println!(
"cargo:rustc-env=SAMPLY_USER_AGENT=Samply.Prism.{}/{}",
env!("CARGO_PKG_NAME"),
version()
);
}