-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: James Goppert <james.goppert@gmail.com>
- Loading branch information
Showing
32 changed files
with
1,511 additions
and
496 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
use std::process::Command; | ||
|
||
fn main() { | ||
// create git hash | ||
// Attempt to retrieve the current Git version | ||
let output = Command::new("git") | ||
.args(["describe", "--dirty", "--tags"]) | ||
.output() | ||
.unwrap(); | ||
let git_hash = String::from_utf8(output.stdout).unwrap(); | ||
.expect("Failed to execute git command"); | ||
|
||
if output.status.success() { | ||
// Convert the hash to a String and trim it | ||
let git_ver = String::from_utf8_lossy(&output.stdout).trim().to_string(); | ||
|
||
// Pass the Git hash to your Rust code via an environment variable | ||
println!("cargo:rustc-env=GIT_VER={}", git_ver); | ||
|
||
// Optionally, display a warning during the build with the hash | ||
println!("cargo:warning=Using Git version: {}", git_ver); | ||
} else { | ||
eprintln!( | ||
"Failed to retrieve Git version: {}", | ||
String::from_utf8_lossy(&output.stderr) | ||
); | ||
} | ||
|
||
// Rerun this build script if `.git/HEAD` or its references change | ||
println!("cargo:rerun-if-changed=.git/HEAD"); | ||
println!("cargo:rustc-env=GIT_HASH={}", git_hash); | ||
println!("cargo:rerun-if-changed=.git/refs/"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pub mod s2_analyzer; | ||
pub mod s3_optimizer; | ||
pub mod s4_generator; | ||
|
||
#[macro_use] | ||
extern crate macro_rules_attribute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.