-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34fb8e9
commit 76759ea
Showing
9 changed files
with
108 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
fn main() { | ||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
// For the githash of the build | ||
vergen::EmitBuilder::builder() | ||
.all_build() | ||
.all_git() | ||
.emit()?; | ||
// make sure tarpaulin is included in the build | ||
println!("cargo::rustc-check-cfg=cfg(tarpaulin_include)"); | ||
println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); | ||
// generated by `sqlx migrate build-script` | ||
// trigger recompilation when a new migration is added | ||
println!("cargo:rerun-if-changed=migrations"); | ||
Ok(()) | ||
} |
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,9 @@ | ||
use std::process::Command; | ||
fn main() { | ||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
// make sure tarpaulin is included in the build | ||
println!("cargo::rustc-check-cfg=cfg(tarpaulin_include)"); | ||
// note: add error checking yourself. | ||
let output = Command::new("git") | ||
.args(["rev-parse", "HEAD"]) | ||
.output() | ||
.unwrap(); | ||
let git_hash = String::from_utf8(output.stdout).unwrap(); | ||
println!("cargo:rustc-env=GIT_HASH={}", git_hash); | ||
println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); | ||
vergen::EmitBuilder::builder() | ||
.all_build() | ||
.all_git() | ||
.emit()?; | ||
Ok(()) | ||
} |
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
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,11 @@ | ||
use std::process::Command; | ||
fn main() { | ||
// use std::process::Command; | ||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
// make sure tarpaulin is included in the build. | ||
println!("cargo::rustc-check-cfg=cfg(tarpaulin_include)"); | ||
// git hash for the build version. | ||
let output = Command::new("git") | ||
.args(["rev-parse", "HEAD"]) | ||
.output() | ||
.unwrap(); | ||
let git_hash = String::from_utf8(output.stdout).unwrap(); | ||
println!("cargo:rustc-env=GIT_HASH={}", git_hash); | ||
println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); | ||
// Git hash of the build. | ||
vergen::EmitBuilder::builder() | ||
.all_build() | ||
.all_git() | ||
.emit()?; | ||
Ok(()) | ||
} |