Use build.rs to properly trigger rebuilds when env vars change, for #44
This commit is contained in:
parent
83b011b9c9
commit
8519480fe4
2 changed files with 12 additions and 0 deletions
9
build.rs
9
build.rs
|
@ -45,4 +45,13 @@ fn main() {
|
||||||
for entry in WalkDir::new("migrations").into_iter().filter_map(|e| e.ok()) {
|
for entry in WalkDir::new("migrations").into_iter().filter_map(|e| e.ok()) {
|
||||||
println!("cargo:rerun-if-changed={}", entry.path().display());
|
println!("cargo:rerun-if-changed={}", entry.path().display());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For build_config.rs
|
||||||
|
for env_var in &[
|
||||||
|
"CONTINUOUS_INTEGRATION",
|
||||||
|
"TRAVIS_BRANCH",
|
||||||
|
"TRAVIS_COMMIT",
|
||||||
|
] {
|
||||||
|
println!("cargo:rerun-if-env-changed={}", env_var);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
|
// The non-CARGO env variables used here must be listed
|
||||||
|
// in build.rs to properly trigger rebuild on change
|
||||||
|
|
||||||
pub const PROJECT_NAME: &str = env!("CARGO_PKG_NAME");
|
pub const PROJECT_NAME: &str = env!("CARGO_PKG_NAME");
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
|
|
Loading…
Reference in a new issue