Attempt to fix compilation issues on CI

Can't reproduce the errors on Azure locally, but hopefully tweaking
generated code can get things to work.
This commit is contained in:
Alex Crichton 2019-06-10 08:46:30 -07:00
parent c3e0edd956
commit 535aa3193c
9 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,3 @@
use js_sys::Object;
use wasm_bindgen::Clamped;
use wasm_bindgen_test::*;

View File

@ -1,4 +1,3 @@
use js_sys::Object;
use wasm_bindgen_test::*;
include!(concat!(env!("OUT_DIR"), "/array_buffer.rs"));

View File

@ -19,6 +19,15 @@ fn main() {
println!("processing {:?}", path);
let mut generated_rust = wasm_bindgen_webidl::compile(&idl, None).unwrap();
generated_rust.insert_str(
0,
"
mod generated_code {
#[allow(unused_imports)]
use js_sys::Object;
",
);
let out_file = out_dir.join(path.file_name().unwrap()).with_extension("rs");
generated_rust.push_str(&format!(
@ -44,6 +53,8 @@ fn main() {
i
));
generated_rust.push_str("}\nuse self::generated_code::*;");
fs::write(&out_file, generated_rust).unwrap();
// Attempt to run rustfmt, but don't worry if it fails or if it isn't

View File

@ -1,4 +1,4 @@
use js_sys::{Function, Object};
use js_sys::Function;
use wasm_bindgen_test::*;
include!(concat!(env!("OUT_DIR"), "/callbacks.rs"));

View File

@ -1,4 +1,3 @@
use js_sys::Object;
use wasm_bindgen_test::*;
include!(concat!(env!("OUT_DIR"), "/consts.rs"));

View File

@ -1,4 +1,3 @@
use js_sys::Object;
use wasm_bindgen_test::*;
include!(concat!(env!("OUT_DIR"), "/enums.rs"));

View File

@ -1,4 +1,3 @@
use js_sys::Object;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;

View File

@ -1,4 +1,3 @@
use js_sys::Object;
use wasm_bindgen_test::*;
include!(concat!(env!("OUT_DIR"), "/no_interface.rs"));

View File

@ -1,4 +1,3 @@
use js_sys::Object;
use wasm_bindgen_test::*;
include!(concat!(env!("OUT_DIR"), "/throws.rs"));