diff --git a/.travis.yml b/.travis.yml index 17beccc628..5882493b3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,9 +31,10 @@ script: - git add -A - git diff @ - git diff-index --quiet HEAD - - cargo test -p tests_expectations - cargo build --features "$BINDGEN_FEATURES _docs" - - cd .. + - cd tests/expectations + - cargo test + - cd ../../../bindgen - cargo test --features "$BINDGEN_FEATURES" - cargo test --release --features "$BINDGEN_FEATURES" diff --git a/Cargo.toml b/Cargo.toml index 57be684ee8..dd953a9760 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,25 +1,6 @@ -[package] -authors = [ - "Jyun-Yan You ", - "Emilio Cobos Álvarez ", - "The Servo project developers", +[workspace] +members = [ + "bindgen", + "libbindgen", + "libbindgen/tests/expectations", ] -description = "A binding generator for Rust" -homepage = "https://github.com/servo/rust-bindgen" -keywords = ["bindings", "ffi", "code-generation"] -license = "BSD-3-Clause" -name = "bindgen" -readme = "README.md" -repository = "https://github.com/servo/rust-bindgen" -version = "0.17.0" - -[dependencies] -clang-sys = "0.11.1" -clap = "2" -libbindgen = { path = "libbindgen" } -log = "0.3" -env_logger = "0.3" -rustc-serialize = "0.3.19" - -[features] -llvm_stable = ["libbindgen/llvm_stable"] diff --git a/bindgen/Cargo.toml b/bindgen/Cargo.toml new file mode 100644 index 0000000000..1ac99d0389 --- /dev/null +++ b/bindgen/Cargo.toml @@ -0,0 +1,26 @@ +[package] +authors = [ + "Jyun-Yan You ", + "Emilio Cobos Álvarez ", + "The Servo project developers", +] +description = "A binding generator for Rust" +homepage = "https://github.com/servo/rust-bindgen" +keywords = ["bindings", "ffi", "code-generation"] +license = "BSD-3-Clause" +name = "bindgen" +readme = "README.md" +repository = "https://github.com/servo/rust-bindgen" +version = "0.17.0" +workspace = ".." + +[dependencies] +clang-sys = "0.11.1" +clap = "2" +libbindgen = { path = "../libbindgen" } +log = "0.3" +env_logger = "0.3" +rustc-serialize = "0.3.19" + +[features] +llvm_stable = ["libbindgen/llvm_stable"] diff --git a/src/main.rs b/bindgen/src/main.rs similarity index 100% rename from src/main.rs rename to bindgen/src/main.rs diff --git a/src/options.rs b/bindgen/src/options.rs similarity index 100% rename from src/options.rs rename to bindgen/src/options.rs diff --git a/libbindgen/Cargo.toml b/libbindgen/Cargo.toml index a094824c4f..4b3a4f4918 100644 --- a/libbindgen/Cargo.toml +++ b/libbindgen/Cargo.toml @@ -12,13 +12,13 @@ license = "BSD-3-Clause" name = "libbindgen" readme = "README.md" repository = "https://github.com/servo/rust-bindgen" -version = "0.17.0" +version = "0.1.0" +workspace = ".." [dev-dependencies] diff = "0.1" clap = "2" shlex = "0.1" -tests_expectations = { path = "tests/expectations" } [build-dependencies] quasi_codegen = "0.21" diff --git a/libbindgen/README.md b/libbindgen/README.md new file mode 100644 index 0000000000..e0bbddf50b --- /dev/null +++ b/libbindgen/README.md @@ -0,0 +1,3 @@ +# `libbindgen` + +Generate Rust FFI bindings from C/C++ header files. diff --git a/libbindgen/tests/expectations/Cargo.toml b/libbindgen/tests/expectations/Cargo.toml index 53f1b14f46..0980c56432 100644 --- a/libbindgen/tests/expectations/Cargo.toml +++ b/libbindgen/tests/expectations/Cargo.toml @@ -7,5 +7,6 @@ authors = [ "Emilio Cobos Álvarez ", "The Servo project developers", ] +workspace = "../../.." [dependencies] diff --git a/libbindgen/tests/tests.rs b/libbindgen/tests/tests.rs index e4a62523ea..12816c1b0b 100644 --- a/libbindgen/tests/tests.rs +++ b/libbindgen/tests/tests.rs @@ -7,7 +7,7 @@ use std::fs; use std::io::{BufRead, BufReader, Error, ErrorKind, Read, Write}; use std::path::PathBuf; -#[path="../../src/options.rs"] +#[path="../../bindgen/src/options.rs"] mod options; use options::builder_from_flags;