mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Merge pull request #396 from fitzgen/pull-project-testing-out-into-its-own-crate
tests: Pull the `project()` builder out into its own crate
This commit is contained in:
commit
bc2eab1434
@ -33,8 +33,7 @@ serde = { version = "1.0", optional = true }
|
||||
serde_json = { version = "1.0", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
lazy_static = "1"
|
||||
wasm-bindgen-cli-support = { path = "crates/cli-support", version = '=0.2.11' }
|
||||
wasm-bindgen-test-project-builder = { path = "crates/test-project-builder", version = '=0.2.11' }
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
|
8
crates/test-project-builder/Cargo.toml
Normal file
8
crates/test-project-builder/Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "wasm-bindgen-test-project-builder"
|
||||
version = "0.2.11"
|
||||
authors = ["Nick Fitzgerald <fitzgen@gmail.com>"]
|
||||
|
||||
[dependencies]
|
||||
lazy_static = "1"
|
||||
wasm-bindgen-cli-support = { path = "../cli-support", version = '=0.2.11' }
|
@ -1,4 +1,6 @@
|
||||
use wasm_bindgen_cli_support as cli;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate wasm_bindgen_cli_support as cli;
|
||||
|
||||
use std::env;
|
||||
use std::fs::{self, File};
|
||||
@ -29,7 +31,7 @@ pub struct Project {
|
||||
}
|
||||
|
||||
pub fn project() -> Project {
|
||||
let dir = Path::new(env!("CARGO_MANIFEST_DIR"));
|
||||
let dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
|
||||
let mut lockfile = String::new();
|
||||
fs::File::open(&dir.join("Cargo.lock"))
|
||||
.unwrap()
|
||||
@ -217,7 +219,7 @@ impl Project {
|
||||
manifest.push_str("[build-dependencies]\n");
|
||||
manifest.push_str("wasm-bindgen-webidl = { path = '");
|
||||
manifest.push_str(env!("CARGO_MANIFEST_DIR"));
|
||||
manifest.push_str("/crates/webidl' }\n");
|
||||
manifest.push_str("/../webidl' }\n");
|
||||
|
||||
manifest.push_str("[dependencies]\n");
|
||||
for dep in self.deps.iter() {
|
||||
@ -226,7 +228,7 @@ impl Project {
|
||||
}
|
||||
manifest.push_str("wasm-bindgen = { path = '");
|
||||
manifest.push_str(env!("CARGO_MANIFEST_DIR"));
|
||||
manifest.push_str("'");
|
||||
manifest.push_str("/../..'");
|
||||
if self.no_std {
|
||||
manifest.push_str(", default-features = false");
|
||||
}
|
||||
@ -826,4 +828,3 @@ fn run_in_background(cmd: &mut Command, name: String) -> BackgroundChild {
|
||||
stdin: Some(stdin),
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate wasm_bindgen_cli_support;
|
||||
extern crate wasm_bindgen_test_project_builder as project_builder;
|
||||
|
||||
mod project_builder;
|
||||
use project_builder::{project, run};
|
||||
|
||||
mod api;
|
||||
|
Loading…
x
Reference in New Issue
Block a user