Skip to content
Snippets Groups Projects
Commit bd043fec authored by Udo Eisenbarth's avatar Udo Eisenbarth :speech_balloon:
Browse files

Resolve "CLI: show git commit hash in version info"

parent 4767dde5
No related branches found
No related tags found
1 merge request!20Resolve "CLI: show git commit hash in version info"
...@@ -80,6 +80,12 @@ dependencies = [ ...@@ -80,6 +80,12 @@ dependencies = [
"windows-sys", "windows-sys",
] ]
[[package]]
name = "anyhow"
version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
[[package]] [[package]]
name = "approx" name = "approx"
version = "0.5.1" version = "0.5.1"
...@@ -323,6 +329,12 @@ dependencies = [ ...@@ -323,6 +329,12 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "deranged"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946"
[[package]] [[package]]
name = "dirs-next" name = "dirs-next"
version = "2.0.0" version = "2.0.0"
...@@ -745,6 +757,15 @@ dependencies = [ ...@@ -745,6 +757,15 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "num_threads"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.18.0" version = "1.18.0"
...@@ -756,6 +777,7 @@ name = "opossum" ...@@ -756,6 +777,7 @@ name = "opossum"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"approx", "approx",
"chrono",
"clap 4.4.6", "clap 4.4.6",
"csv", "csv",
"ndarray", "ndarray",
...@@ -770,6 +792,7 @@ dependencies = [ ...@@ -770,6 +792,7 @@ dependencies = [
"structopt", "structopt",
"strum", "strum",
"uom", "uom",
"vergen",
] ]
[[package]] [[package]]
...@@ -1187,6 +1210,36 @@ dependencies = [ ...@@ -1187,6 +1210,36 @@ dependencies = [
"syn 2.0.37", "syn 2.0.37",
] ]
[[package]]
name = "time"
version = "0.3.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe"
dependencies = [
"deranged",
"itoa",
"libc",
"num_threads",
"serde",
"time-core",
"time-macros",
]
[[package]]
name = "time-core"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]]
name = "time-macros"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20"
dependencies = [
"time-core",
]
[[package]] [[package]]
name = "ttf-parser" name = "ttf-parser"
version = "0.17.1" version = "0.17.1"
...@@ -1245,6 +1298,17 @@ version = "0.8.2" ...@@ -1245,6 +1298,17 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]]
name = "vergen"
version = "8.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85e7dc29b3c54a2ea67ef4f953d5ec0c4085035c0ae2d325be1c0d2144bd9f16"
dependencies = [
"anyhow",
"rustversion",
"time",
]
[[package]] [[package]]
name = "version_check" name = "version_check"
version = "0.9.4" version = "0.9.4"
......
...@@ -10,6 +10,8 @@ keywords = ["laser", "optics", "physics", "simulation"] ...@@ -10,6 +10,8 @@ keywords = ["laser", "optics", "physics", "simulation"]
categories = [ "science", "simulation"] categories = [ "science", "simulation"]
publish = false publish = false
build = "build.rs"
[dependencies] [dependencies]
petgraph = {version="0.6.3", features = ["serde-1"]} # the graph library petgraph = {version="0.6.3", features = ["serde-1"]} # the graph library
uom = "0" uom = "0"
...@@ -29,3 +31,9 @@ clap = { version = "4.4", features = ["derive"] } # command line argument parser ...@@ -29,3 +31,9 @@ clap = { version = "4.4", features = ["derive"] } # command line argument parser
structopt = "0.3" structopt = "0.3"
rprompt = "2.0" rprompt = "2.0"
strum = { version = "0.25", features = ["derive"] } strum = { version = "0.25", features = ["derive"] }
chrono = "0"
[build-dependencies]
# All features enabled
vergen = { version = "8.2", features = ["git", "gitcl"] }
use std::error::Error;
use vergen::EmitBuilder;
pub fn main() -> Result<(), Box<dyn Error>> {
println!("cargo:rerun-if-changed=build.rs");
EmitBuilder::builder().all_git().emit()?;
Ok(())
}
use crate::{analyzer::AnalyzerType, error::OpossumError}; use crate::{analyzer::AnalyzerType, error::OpossumError};
use chrono::DateTime;
use clap::{builder::OsStr, Parser}; use clap::{builder::OsStr, Parser};
use rprompt::prompt_reply; use rprompt::prompt_reply;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
...@@ -210,12 +211,18 @@ GBB? .BBB: PBBPYYYJJ7^ YBBY .GBBG#&&#BBBBBBBB#&&#Y. .:^!YBB ...@@ -210,12 +211,18 @@ GBB? .BBB: PBBPYYYJJ7^ YBBY .GBBG#&&#BBBBBBBB#&&#Y. .:^!YBB
.^!?5BBB! .^!?5BBB!
^55J !BBG ^55J !BBG
5BBP!^:^7GBB! 5BBP!^:^7GBB!
^JPBBBBG5?. ^JPBBBBG5?.\n");
println!(
"{: ^119}",
Opossum - Open-source Optics Simulation System and Unified Modeler "Opossum - Open-source Optics Simulation System and Unified Modeler"
);
") let timestamp = DateTime::parse_from_rfc3339(env!("VERGEN_GIT_COMMIT_TIMESTAMP")).unwrap();
let version_string = format!(
" version {} ({})",
env!("VERGEN_GIT_DESCRIBE"),
timestamp.format("%Y/%m/%d %H:%M")
);
println!("{: ^119}\n", version_string);
} }
#[cfg(test)] #[cfg(test)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment