Explicitly list inputs to the style crate's build script

This avoids unncessary build script runs caused by changes to unrelated files.
This commit is contained in:
Matt Brubeck 2016-05-11 10:44:33 -07:00
parent 81246a7b61
commit 65e6938291
6 changed files with 57 additions and 0 deletions

View file

@ -2,9 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
extern crate walkdir;
use std::env;
use std::path::Path;
use std::process::{Command, exit};
use walkdir::WalkDir;
#[cfg(windows)]
fn find_python() -> String {
@ -29,6 +32,17 @@ fn find_python() -> String {
}
fn main() {
println!("cargo:rerun-if-changed=build.rs");
for entry in WalkDir::new("properties") {
let entry = entry.unwrap();
match entry.path().extension().and_then(|e| e.to_str()) {
Some("mako") | Some("rs") | Some("py") | Some("zip") => {
println!("cargo:rerun-if-changed={}", entry.path().display());
}
_ => {}
}
}
let python = env::var("PYTHON").ok().unwrap_or_else(find_python);
let script = Path::new(file!()).parent().unwrap().join("properties").join("build.py");
let product = if cfg!(feature = "gecko") { "gecko" } else { "servo" };