diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c512697..eee5279 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,4 +34,4 @@ jobs: - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features + args: --all-features --workspace diff --git a/.rusty-hook.toml b/.rusty-hook.toml index ceffa65..e837c7e 100644 --- a/.rusty-hook.toml +++ b/.rusty-hook.toml @@ -1,6 +1,6 @@ [hooks] pre-commit = "cargo clippy -- -D warnings" -pre-push = "cargo check & cargo test --all-features" +pre-push = "cargo check & cargo test --all-features --workspace" [logging] verbose = true diff --git a/Cargo.toml b/Cargo.toml index b74a5b1..f5f78bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,12 +7,9 @@ description = "Compile-time annotation parser for rust" repository = "https://github.com/dark-flames/annotation-rs" keywords = ["annotation"] include = [ - "src/**", - "derive/**", - "helpers/**", - "tests/**", - "LICENSE-APACHE", - "LICENSE-MIT", + "/src/**", + "/LICENSE-APACHE", + "/LICENSE-MIT", "/Cargo.toml", "/README.md", ] @@ -24,11 +21,6 @@ derive = { package = "annotation-rs-codegen", path = "./derive", version = "0.1. helpers = { package = "annotation-rs-helpers", path = "./helpers", version = "0.1.0" } syn = "1.0" -[dev-dependencies] -objects = { package = "annotations-test-objects", path = "tests/objects", version = "0.1.0" } -macros = { package = "annotation-rs-test-macros", path = "tests/macros", version = "0.1.0" } -float-cmp = "0.8.0" - [features] annotation_reader=[] diff --git a/derive/Cargo.toml b/derive/Cargo.toml index 5c7e887..4fc23df 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -3,13 +3,22 @@ name = "annotation-rs-codegen" version = "0.1.0" authors = ["dark-flames "] edition = "2018" +license = "MIT OR Apache-2.0" description = "proc-macro lib for annotation-rs" repository = "https://github.com/dark-flames/annotation-rs" +include = [ + "/src/**", + "/LICENSE-APACHE", + "/LICENSE-MIT", + "/Cargo.toml", + "/README.md", +] +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -helpers = { package = "annotation-rs-helpers", path = "../helpers" } +helpers = { package = "annotation-rs-helpers", path = "../helpers", version = "0.1.0" } quote = "1.0" proc-macro2 = "1.0" heck = "0.3.1" diff --git a/derive/crates-io.md b/derive/crates-io.md deleted file mode 100644 index 32d46ee..0000000 --- a/derive/crates-io.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/helpers/Cargo.toml b/helpers/Cargo.toml index a4a585e..f94d820 100644 --- a/helpers/Cargo.toml +++ b/helpers/Cargo.toml @@ -3,8 +3,17 @@ name = "annotation-rs-helpers" version = "0.1.0" authors = ["dark-flames "] edition = "2018" +license = "MIT OR Apache-2.0" description = "internal helper lib for annotation-rs" repository = "https://github.com/dark-flames/annotation-rs" +include = [ + "/src/**", + "/LICENSE-APACHE", + "/LICENSE-MIT", + "/Cargo.toml", + "/README.md", +] +readme = "README.md" [dependencies] syn = "1.0" diff --git a/helpers/crates-io.md b/helpers/crates-io.md deleted file mode 100644 index 32d46ee..0000000 --- a/helpers/crates-io.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/tests/macros/Cargo.toml b/tests/macros/Cargo.toml index fcbdb0b..1cb34a4 100644 --- a/tests/macros/Cargo.toml +++ b/tests/macros/Cargo.toml @@ -3,8 +3,17 @@ name = "annotation-rs-test-macros" version = "0.1.0" authors = ["dark-flames "] edition = "2018" +license = "MIT OR Apache-2.0" description = "test macros for annotation-rs" repository = "https://github.com/dark-flames/annotation-rs" +include = [ + "/src/**", + "/LICENSE-APACHE", + "/LICENSE-MIT", + "/Cargo.toml", + "/README.md", +] +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -12,9 +21,10 @@ repository = "https://github.com/dark-flames/annotation-rs" syn = "1.0" proc-macro2 = "1.0" quote = "1.0" -objects = { package = "annotations-test-objects", path = "../objects" } -derive = { package = "annotation-rs-codegen", path = "../../derive" } -annotation-rs = { path = "../../"} +objects = { package = "annotation-test-objects", path = "../objects", version = "0.1.0" } +derive = { package = "annotation-rs-codegen", path = "../../derive", version = "0.1" } +annotation-rs = { path = "../../", version = "0.1.0", features = ["annotation_reader"]} +float-cmp = "0.8.0" [lib] proc-macro = true \ No newline at end of file diff --git a/tests/macros/LICENSE-APACHE b/tests/macros/LICENSE-APACHE deleted file mode 120000 index 6643929..0000000 --- a/tests/macros/LICENSE-APACHE +++ /dev/null @@ -1 +0,0 @@ -./LICENSE-APACHE \ No newline at end of file diff --git a/tests/macros/LICENSE-APACHE b/tests/macros/LICENSE-APACHE new file mode 100644 index 0000000..6643929 --- /dev/null +++ b/tests/macros/LICENSE-APACHE @@ -0,0 +1 @@ +./LICENSE-APACHE \ No newline at end of file diff --git a/tests/macros/LICENSE-MIT b/tests/macros/LICENSE-MIT deleted file mode 120000 index d160832..0000000 --- a/tests/macros/LICENSE-MIT +++ /dev/null @@ -1 +0,0 @@ -./LICENSE-MIT \ No newline at end of file diff --git a/tests/macros/LICENSE-MIT b/tests/macros/LICENSE-MIT new file mode 100644 index 0000000..d160832 --- /dev/null +++ b/tests/macros/LICENSE-MIT @@ -0,0 +1 @@ +./LICENSE-MIT \ No newline at end of file diff --git a/tests/macros/README.md b/tests/macros/README.md deleted file mode 120000 index 61cfe9a..0000000 --- a/tests/macros/README.md +++ /dev/null @@ -1 +0,0 @@ -./README.md \ No newline at end of file diff --git a/tests/macros/README.md b/tests/macros/README.md new file mode 100644 index 0000000..61cfe9a --- /dev/null +++ b/tests/macros/README.md @@ -0,0 +1 @@ +./README.md \ No newline at end of file diff --git a/tests/full_test.rs b/tests/macros/tests/full_test.rs similarity index 87% rename from tests/full_test.rs rename to tests/macros/tests/full_test.rs index 2efffbb..667fc2c 100644 --- a/tests/full_test.rs +++ b/tests/macros/tests/full_test.rs @@ -1,13 +1,11 @@ #![feature(proc_macro_hygiene)] -#[cfg(any(feature = "annotation_reader"))] use annotation_rs::get_annotation; +use annotation_rs_test_macros::FullDerive; use float_cmp::approx_eq; -use macros::FullDerive; use objects::attributes::Full; use objects::enums::TestEnum; -#[cfg(any(feature = "annotation_reader"))] #[derive(FullDerive)] #[Full( object(i32 = 1, u16 = 2, float = 1.1, string = "test", enum2 = "aaa"), @@ -18,7 +16,6 @@ use objects::enums::TestEnum; )] struct Test; -#[cfg(any(feature = "annotation_reader"))] #[test] pub fn test_full() { let attr: Full = get_annotation!(Test, Full).unwrap(); diff --git a/tests/simple_test.rs b/tests/macros/tests/simple_test.rs similarity index 80% rename from tests/simple_test.rs rename to tests/macros/tests/simple_test.rs index 0d30050..a7127ae 100644 --- a/tests/simple_test.rs +++ b/tests/macros/tests/simple_test.rs @@ -1,18 +1,15 @@ #![feature(proc_macro_hygiene)] -#[cfg(any(feature = "annotation_reader"))] use annotation_rs::get_annotation; +use annotation_rs_test_macros::SimpleDerive; use float_cmp::approx_eq; -use macros::SimpleDerive; use objects::attributes::Simple; use objects::enums::TestEnum; -#[cfg(any(feature = "annotation_reader"))] #[derive(SimpleDerive)] #[Simple(i32 = 1, u16 = 2, float = 1.1, string = "test", enum2 = "aaa")] struct Test; -#[cfg(any(feature = "annotation_reader"))] #[test] pub fn simple_test() { let attr: Simple = get_annotation!(Test, Simple).unwrap(); diff --git a/tests/objects/Cargo.toml b/tests/objects/Cargo.toml index de7b8c4..55d65b9 100644 --- a/tests/objects/Cargo.toml +++ b/tests/objects/Cargo.toml @@ -1,11 +1,19 @@ [package] -name = "annotations-test-objects" +name = "annotation-test-objects" version = "0.1.0" authors = ["dark-flames "] license = "MIT OR Apache-2.0" edition = "2018" description = "test objects for annotation-rs" repository = "https://github.com/dark-flames/annotation-rs" +include = [ + "/src/**", + "/LICENSE-APACHE", + "/LICENSE-MIT", + "/Cargo.toml", + "/README.md", +] +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -13,5 +21,5 @@ repository = "https://github.com/dark-flames/annotation-rs" syn = "1.0" proc-macro2 = "1.0" quote = "1.0" -derive = { package = "annotation-rs-codegen", path = "../../derive" } -annotation-rs = { path = "../../"} +derive = { package = "annotation-rs-codegen", path = "../../derive", version = "0.1" } +annotation-rs = { path = "../../", version = "0.1.0" } diff --git a/tests/objects/LICENSE-APACHE b/tests/objects/LICENSE-APACHE deleted file mode 120000 index 6643929..0000000 --- a/tests/objects/LICENSE-APACHE +++ /dev/null @@ -1 +0,0 @@ -./LICENSE-APACHE \ No newline at end of file diff --git a/tests/objects/LICENSE-APACHE b/tests/objects/LICENSE-APACHE new file mode 100644 index 0000000..6643929 --- /dev/null +++ b/tests/objects/LICENSE-APACHE @@ -0,0 +1 @@ +./LICENSE-APACHE \ No newline at end of file diff --git a/tests/objects/LICENSE-MIT b/tests/objects/LICENSE-MIT deleted file mode 120000 index d160832..0000000 --- a/tests/objects/LICENSE-MIT +++ /dev/null @@ -1 +0,0 @@ -./LICENSE-MIT \ No newline at end of file diff --git a/tests/objects/LICENSE-MIT b/tests/objects/LICENSE-MIT new file mode 100644 index 0000000..d160832 --- /dev/null +++ b/tests/objects/LICENSE-MIT @@ -0,0 +1 @@ +./LICENSE-MIT \ No newline at end of file diff --git a/tests/objects/README.md b/tests/objects/README.md deleted file mode 120000 index 61cfe9a..0000000 --- a/tests/objects/README.md +++ /dev/null @@ -1 +0,0 @@ -./README.md \ No newline at end of file diff --git a/tests/objects/README.md b/tests/objects/README.md new file mode 100644 index 0000000..61cfe9a --- /dev/null +++ b/tests/objects/README.md @@ -0,0 +1 @@ +./README.md \ No newline at end of file