Auto-generate CSSStyleDeclaration.webidl for CSS properties based on the style crate

This commit is contained in:
Simon Sapin 2019-07-26 21:54:42 +02:00
parent 447ae1eae6
commit f1300bb98b
7 changed files with 83 additions and 485 deletions

View file

@ -15,6 +15,13 @@ use std::time::Instant;
fn main() {
let start = Instant::now();
let style_out_dir = PathBuf::from(env::var_os("DEP_SERVO_STYLE_CRATE_OUT_DIR").unwrap());
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
let build_dir = out_dir.join("build");
let json = "css_properties.json";
let _ = std::fs::create_dir(&build_dir); // Ignore errors: they most likely indicate it already exists
std::fs::copy(style_out_dir.join(json), build_dir.join(json)).unwrap();
// This must use the Ninja generator -- it's the only one that
// parallelizes cmake's output properly. (Cmake generates
// separate makefiles, each of which try to build
@ -35,7 +42,7 @@ fn main() {
start.elapsed().as_secs()
);
let json = PathBuf::from(env::var_os("OUT_DIR").unwrap())
let json = out_dir
.join("build")
.join("InterfaceObjectMapData.json");
let json: Value = serde_json::from_reader(File::open(&json).unwrap()).unwrap();