Move compile-time build info to aiken-project
So that we can use it as part of the blueprints.
This commit is contained in:
@@ -12,6 +12,7 @@ authors = [
|
||||
"KtorZ <matthias.benkort@gmail.com>",
|
||||
]
|
||||
rust-version = "1.66.1"
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
askama = "0.12.0"
|
||||
@@ -48,3 +49,6 @@ uplc = { path = '../uplc', version = "1.0.19-alpha" }
|
||||
[dev-dependencies]
|
||||
proptest = "1.2.0"
|
||||
pretty_assertions = "1.3.0"
|
||||
|
||||
[build-dependencies]
|
||||
built = { version = "0.6.0", features = ["git2"] }
|
||||
|
||||
3
crates/aiken-project/build.rs
Normal file
3
crates/aiken-project/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
built::write_built_file().expect("Failed to acquire build-time information");
|
||||
}
|
||||
@@ -116,3 +116,19 @@ impl Config {
|
||||
Some(self)
|
||||
}
|
||||
}
|
||||
|
||||
mod built_info {
|
||||
include!(concat!(env!("OUT_DIR"), "/built.rs"));
|
||||
}
|
||||
|
||||
pub fn compiler_version(include_commit_hash: bool) -> String {
|
||||
if include_commit_hash {
|
||||
format!(
|
||||
"v{} {}",
|
||||
built_info::PKG_VERSION_MAJOR,
|
||||
built_info::GIT_COMMIT_HASH_SHORT.unwrap_or("unknown")
|
||||
)
|
||||
} else {
|
||||
format!("v{}", built_info::PKG_VERSION_MAJOR,)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user