1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-04-02 18:31:05 +00:00

web-sys: only try to build webidl files ()

This commit is contained in:
Julius Rakow 2018-07-14 18:04:20 +02:00 committed by Alex Crichton
parent 696678b8cc
commit e49e02cc88

@ -4,6 +4,7 @@ extern crate wasm_bindgen_webidl;
use failure::ResultExt; use failure::ResultExt;
use std::env; use std::env;
use std::ffi::OsStr;
use std::fs; use std::fs;
use std::io::Write; use std::io::Write;
use std::path; use std::path;
@ -28,12 +29,14 @@ fn try_main() -> Result<(), failure::Error> {
let mut contents = String::new(); let mut contents = String::new();
for entry in entries { for entry in entries {
let entry = entry.context("getting webidls/enabled/* entry")?; let entry = entry.context("getting webidls/enabled/*.webidl entry")?;
println!("cargo:rerun-if-changed={}", entry.path().display()); if entry.path().extension() == Some(OsStr::new("webidl")) {
println!("cargo:rerun-if-changed={}", entry.path().display());
let this_contents = let this_contents =
fs::read_to_string(entry.path()).context("reading WebIDL file contents")?; fs::read_to_string(entry.path()).context("reading WebIDL file contents")?;
contents.push_str(&this_contents); contents.push_str(&this_contents);
}
} }
let bindings = wasm_bindgen_webidl::compile(&contents) let bindings = wasm_bindgen_webidl::compile(&contents)