From 7c6e56f5a497ed0d04f7a4dffd02d0d2c8085e9f Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 7 May 2015 18:18:08 -0700 Subject: [PATCH 1/2] Prepare to publish on crates.io --- Cargo.toml | 16 +++++++--------- README.md | 4 ++-- capi/Cargo.toml | 9 +++------ dom_sink/Cargo.toml | 14 +++++++------- macros/Cargo.toml | 6 ++---- test_util/Cargo.toml | 2 +- 6 files changed, 22 insertions(+), 29 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ad0c633b..0643c283 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,11 @@ [package] name = "html5ever" -version = "0.0.0" +version = "0.1.0" authors = [ "The html5ever Project Developers" ] +license = "MIT / Apache-2.0" +repository = "https://github.com/servo/html5ever" +description = "High-performance browser-grade HTML5 parser" [lib] name = "html5ever" @@ -15,14 +18,9 @@ time = "0" log = "0" phf = "0.7" phf_macros = "0.7" - -[dependencies.string_cache] -git = "https://github.com/servo/string-cache" -[dependencies.string_cache_plugin] -git = "https://github.com/servo/string-cache" - -[dependencies.mac] -git = "https://github.com/reem/rust-mac" +string_cache = "0" +string_cache_plugin = "0" +mac = "0" [dependencies.html5ever_macros] path = "macros" diff --git a/README.md b/README.md index 8a4c9e6b..1ec420df 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ html5ever is written in [Rust](http://www.rust-lang.org/), so it avoids the most Add html5ever as a dependency in your [`Cargo.toml`](http://crates.io/) file: ```toml -[dependencies.html5ever] -git = "https://github.com/servo/html5ever" +[dependencies] +html5ever = "*" ``` Then take a look at [`examples/print-rcdom.rs`](https://github.com/servo/html5ever/blob/master/examples/print-rcdom.rs) and the [API documentation][]. diff --git a/capi/Cargo.toml b/capi/Cargo.toml index d665d752..28b2b9f7 100644 --- a/capi/Cargo.toml +++ b/capi/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "html5ever_capi" -version = "0.0.0" +version = "0.1.0" authors = [ "The html5ever Project Developers" ] [lib] @@ -10,11 +10,8 @@ crate-type = ["staticlib"] [dependencies] libc = "0" +string_cache = "0" +string_cache_plugin = "0" [dependencies.html5ever] path = "../" - -[dependencies.string_cache] -git = "https://github.com/servo/string-cache" -[dependencies.string_cache_plugin] -git = "https://github.com/servo/string-cache" diff --git a/dom_sink/Cargo.toml b/dom_sink/Cargo.toml index 10749c51..7edc4156 100644 --- a/dom_sink/Cargo.toml +++ b/dom_sink/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "html5ever_dom_sink" -version = "0.0.0" +version = "0.1.0" authors = [ "The html5ever Project Developers" ] +description = "Basic DOM implementation for html5ever" +license = "MIT / Apache-2.0" [lib] name = "html5ever_dom_sink" +[dependencies] +mac = "0" +string_cache = "0" + [dependencies.html5ever] path = "../" - -[dependencies.mac] -git = "https://github.com/reem/rust-mac" - -[dependencies.string_cache] -git = "https://github.com/servo/string-cache" diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 9bcecfbd..f2b9b71b 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "html5ever_macros" -version = "0.0.0" +version = "0.1.0" authors = [ "The html5ever Project Developers" ] [lib] @@ -11,6 +11,4 @@ plugin = true [dependencies] rustc-serialize = "0" - -[dependencies.mac] -git = "https://github.com/reem/rust-mac" +mac = "0" diff --git a/test_util/Cargo.toml b/test_util/Cargo.toml index 9b682e86..b2ff3a08 100644 --- a/test_util/Cargo.toml +++ b/test_util/Cargo.toml @@ -1,5 +1,5 @@ [package] name = "test_util" -version = "0.0.0" +version = "0.1.0" authors = [ "The html5ever Project Developers" ] From 6fc7238144d5157b43198a09ecfc848e31af0668 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 16 Jun 2015 00:02:08 +0200 Subject: [PATCH 2/2] Make html5ever not depend on html5ever_dom_sink Move some tests. --- Cargo.toml | 7 +++---- dom_sink/Cargo.toml | 9 +++++++++ {examples => dom_sink/examples}/html2html.rs | 0 {examples => dom_sink/examples}/print-rcdom.rs | 0 {tests => dom_sink/tests}/serializer.rs | 0 {tests => dom_sink/tests}/tree_builder.rs | 6 +++--- macros/Cargo.toml | 3 +++ scripts/travis-build.sh | 7 +++++-- test_util/Cargo.toml | 5 ++++- tests/tokenizer.rs | 4 ++-- 10 files changed, 29 insertions(+), 12 deletions(-) rename {examples => dom_sink/examples}/html2html.rs (100%) rename {examples => dom_sink/examples}/print-rcdom.rs (100%) rename {tests => dom_sink/tests}/serializer.rs (100%) rename {tests => dom_sink/tests}/tree_builder.rs (98%) diff --git a/Cargo.toml b/Cargo.toml index 0643c283..b1644f93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,17 +23,16 @@ string_cache_plugin = "0" mac = "0" [dependencies.html5ever_macros] +version = "0.1.0" path = "macros" [dev-dependencies] rustc-serialize = "0" -[dev-dependencies.test_util] +[dev-dependencies.html5ever_test_util] +version = "0.1.0" path = "test_util" -[dev-dependencies.html5ever_dom_sink] -path = "dom_sink" - [profile.dev] debug = false diff --git a/dom_sink/Cargo.toml b/dom_sink/Cargo.toml index 7edc4156..88bade15 100644 --- a/dom_sink/Cargo.toml +++ b/dom_sink/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors = [ "The html5ever Project Developers" ] description = "Basic DOM implementation for html5ever" license = "MIT / Apache-2.0" +repository = "https://github.com/servo/html5ever" [lib] name = "html5ever_dom_sink" @@ -12,5 +13,13 @@ name = "html5ever_dom_sink" mac = "0" string_cache = "0" +[dev-dependencies] +string_cache_plugin = "0" + [dependencies.html5ever] +version = "0.1" path = "../" + +[dev-dependencies.html5ever_test_util] +version = "0.1.0" +path = "../test_util" diff --git a/examples/html2html.rs b/dom_sink/examples/html2html.rs similarity index 100% rename from examples/html2html.rs rename to dom_sink/examples/html2html.rs diff --git a/examples/print-rcdom.rs b/dom_sink/examples/print-rcdom.rs similarity index 100% rename from examples/print-rcdom.rs rename to dom_sink/examples/print-rcdom.rs diff --git a/tests/serializer.rs b/dom_sink/tests/serializer.rs similarity index 100% rename from tests/serializer.rs rename to dom_sink/tests/serializer.rs diff --git a/tests/tree_builder.rs b/dom_sink/tests/tree_builder.rs similarity index 98% rename from tests/tree_builder.rs rename to dom_sink/tests/tree_builder.rs index ddff71f9..ce6f62f3 100644 --- a/tests/tree_builder.rs +++ b/dom_sink/tests/tree_builder.rs @@ -16,9 +16,9 @@ extern crate string_cache; extern crate html5ever; extern crate html5ever_dom_sink; -extern crate test_util; +extern crate html5ever_test_util; -use test_util::foreach_html5lib_test; +use html5ever_test_util::foreach_html5lib_test; use std::{fs, io, env, rt}; use std::io::BufRead; @@ -232,7 +232,7 @@ fn start(argc: isize, argv: *const *const u8) -> isize { rt::args::init(argc, argv); } let args: Vec<_> = env::args().collect(); - let src_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + let src_dir = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap(); let mut ignores = HashSet::new(); { let f = fs::File::open(&src_dir.join("data/test/ignore")).unwrap(); diff --git a/macros/Cargo.toml b/macros/Cargo.toml index f2b9b71b..bf997cde 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -3,6 +3,9 @@ name = "html5ever_macros" version = "0.1.0" authors = [ "The html5ever Project Developers" ] +license = "MIT / Apache-2.0" +repository = "https://github.com/servo/html5ever" +description = "High-performance browser-grade HTML5 parser − compiler plugins" [lib] diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh index 7d927ac9..864c0133 100755 --- a/scripts/travis-build.sh +++ b/scripts/travis-build.sh @@ -16,5 +16,8 @@ cargo test | ./scripts/shrink-test-output.py r=${PIPESTATUS[0]} if [ $r -ne 0 ]; then exit $r; fi -cd capi -cargo test +cargo test --manifest-path dom_sink/Cargo.toml | ./scripts/shrink-test-output.py +r=${PIPESTATUS[0]} +if [ $r -ne 0 ]; then exit $r; fi + +cargo test --manifest-path capi/Cargo.toml diff --git a/test_util/Cargo.toml b/test_util/Cargo.toml index b2ff3a08..c3dff10f 100644 --- a/test_util/Cargo.toml +++ b/test_util/Cargo.toml @@ -1,5 +1,8 @@ [package] -name = "test_util" +name = "html5ever_test_util" version = "0.1.0" authors = [ "The html5ever Project Developers" ] +description = "High-performance browser-grade HTML5 parser − test util" +license = "MIT / Apache-2.0" +repository = "https://github.com/servo/html5ever" diff --git a/tests/tokenizer.rs b/tests/tokenizer.rs index 8e188f30..a3dd041b 100644 --- a/tests/tokenizer.rs +++ b/tests/tokenizer.rs @@ -15,9 +15,9 @@ extern crate rustc_serialize; extern crate string_cache; extern crate html5ever; -extern crate test_util; +extern crate html5ever_test_util; -use test_util::foreach_html5lib_test; +use html5ever_test_util::foreach_html5lib_test; use std::{char, env, rt}; use std::ffi::OsStr;