Add Travis/AppVeyor deployments

This commit is contained in:
Alex Crichton
2018-03-05 19:25:50 -08:00
parent ddf27f0ab1
commit 1db5b3fb50
5 changed files with 79 additions and 9 deletions

View File

@ -5,7 +5,6 @@ authors = ["Alex Crichton <alex@alexcrichton.com>"]
[dependencies]
base64 = "0.9"
failure = "0.1"
parity-wasm = "0.27"
serde_json = "1.0"
wasm-bindgen-shared = { path = "../wasm-bindgen-shared" }

View File

@ -1,5 +1,3 @@
#[macro_use]
extern crate failure;
extern crate parity_wasm;
extern crate wasm_bindgen_shared as shared;
extern crate serde_json;
@ -11,7 +9,6 @@ use std::io::Write;
use std::path::{Path, PathBuf};
use std::slice;
use failure::Error;
use parity_wasm::elements::*;
mod js;
@ -24,6 +21,15 @@ pub struct Bindgen {
typescript: bool,
}
#[derive(Debug)]
pub struct Error(String);
impl<E: std::error::Error> From<E> for Error {
fn from(e: E) -> Error {
Error(e.to_string())
}
}
impl Bindgen {
pub fn new() -> Bindgen {
Bindgen {
@ -65,7 +71,7 @@ impl Bindgen {
};
let stem = input.file_stem().unwrap().to_str().unwrap();
let mut module = parity_wasm::deserialize_file(input).map_err(|e| {
format_err!("{:?}", e)
Error(format!("{:?}", e))
})?;
let programs = extract_programs(&mut module);
@ -107,7 +113,7 @@ impl Bindgen {
let wasm_path = out_dir.join(format!("{}_bg", stem)).with_extension("wasm");
let wasm_bytes = parity_wasm::serialize(module).map_err(|e| {
format_err!("{:?}", e)
Error(format!("{:?}", e))
})?;
let bytes = wasm_gc::Config::new()
.demangle(false)

View File

@ -30,7 +30,7 @@ impl Config {
pub fn generate(&mut self, wasm: &[u8]) -> Result<Output, Error> {
assert!(self.base64);
let module = deserialize_buffer(wasm).map_err(|e| {
format_err!("{:?}", e)
::Error(format!("{:?}", e))
})?;
Ok(Output {
module,