From df2c07573d68da6dbbde81fca703ed2fae122741 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Wed, 17 Jan 2024 13:57:47 +0100 Subject: [PATCH] better deps and move things --- Cargo.toml | 44 ++++++++++--------- members/libpt-bin/Cargo.toml | 41 ----------------- members/libpt-bintols/Cargo.toml | 6 ++- .../lib.rs => libpt-bintols/src/hedu/mod.rs} | 0 members/libpt-ccc/Cargo.toml | 22 ---------- members/libpt-core/Cargo.toml | 2 +- members/libpt-hedu/Cargo.toml | 21 --------- members/libpt-math/Cargo.toml | 4 ++ .../src/lib.rs => libpt-math/src/ccc/mod.rs} | 0 members/libpt-net/Cargo.toml | 6 +-- {members/libpt-bin/src => src}/ccc/mod.rs | 0 {members/libpt-bin/src => src}/hedu/mod.rs | 0 {members/libpt-bin/src => src}/main/args.rs | 0 {members/libpt-bin/src => src}/main/mod.rs | 0 14 files changed, 35 insertions(+), 111 deletions(-) delete mode 100644 members/libpt-bin/Cargo.toml rename members/{libpt-hedu/src/lib.rs => libpt-bintols/src/hedu/mod.rs} (100%) delete mode 100644 members/libpt-ccc/Cargo.toml delete mode 100644 members/libpt-hedu/Cargo.toml rename members/{libpt-ccc/src/lib.rs => libpt-math/src/ccc/mod.rs} (100%) rename {members/libpt-bin/src => src}/ccc/mod.rs (100%) rename {members/libpt-bin/src => src}/hedu/mod.rs (100%) rename {members/libpt-bin/src => src}/main/args.rs (100%) rename {members/libpt-bin/src => src}/main/mod.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 14b4bff..8fe001d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,14 +3,11 @@ resolver = "2" members = [ ".", "members/libpt-core", - "members/libpt-bintols", "members/libpt-math", - "members/libpt-bin", "members/libpt-log", "members/libpt-net", - "members/libpt-hedu", ] -default-members = [".", "members/libpt-bin", "members/libpt-core"] +default-members = [".", "members/libpt-core"] [workspace.package] publish = true version = "0.2.0-alpha.3" @@ -31,8 +28,13 @@ categories = [ [workspace.dependencies] anyhow = "1.0.79" thiserror = "1.0.56" -libpt-log = { version = "0.2.0-alpha.2", path = "../libpt-log" } -libpt-bintols = { version = "0.2.0-alpha.2", ath = "../libpt-bintols" } +libpt-core = { version = "0.2.0-alpha.2", path = "members/libpt-core", registry = "cscherr" } +libpt-bintols = { version = "0.2.0-alpha.2", path = "members/libpt-bintols", registry = "cscherr", optional = true } +libpt-hedu = { version = "0.2.0-alpha.2", path = "members/libpt-hedu", registry = "cscherr", optional = true } +libpt-log = { version = "0.2.0-alpha.2", path = "members/libpt-log", registry = "cscherr", optional = true } +libpt-math = { version = "0.2.0-alpha.2", path = "members/libpt-math", registry = "cscherr", optional = true } +libpt-ccc = { version = "0.2.0-alpha.2", path = "members/libpt-ccc", registry = "cscherr", optional = true } +libpt-net = { version = "0.2.0-alpha.2", path = "members/libpt-net", registry = "cscherr", optional = true } [package] name = "libpt" @@ -52,13 +54,12 @@ categories.workspace = true default = ["log", "core"] all = ["default", "math", "log", "bintols", "net", "ccc", "hedu", "core"] core = [] -fw = [] -math = [] -log = [] -bintols = [] -net = [] +math = ["dep:libpt-math"] +log = ["dep:libpt-log"] +bintols = ["dep:libpt-bintols"] +net = ["dep:libpt-net"] ccc = ["math"] -hedu = ["bintols"] +bin = ["bintols", "math", "dep:clap", "dep:clap-num", "dep:clap-verbosity-flag"] [lib] name = "libpt" @@ -68,13 +69,14 @@ crate-type = [ "rlib", ] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] -libpt-bintols = { version = "0.2.0-alpha.2", path = "members/libpt-bintols", registry="cscherr"} -libpt-core = { version = "0.2.0-alpha.2", path = "members/libpt-core", registry="cscherr" } -libpt-hedu = { version = "0.2.0-alpha.2", path = "members/libpt-hedu", registry="cscherr" } -libpt-log = { version = "0.2.0-alpha.2", path = "members/libpt-log", registry="cscherr" } -libpt-math = { version = "0.2.0-alpha.2", path = "members/libpt-math", registry="cscherr" } -libpt-ccc = { version = "0.2.0-alpha.2", path = "members/libpt-ccc", registry="cscherr" } -libpt-net = { version = "0.2.0-alpha.2", path = "members/libpt-net", registry="cscherr" } +libpt-core = { workspace = true } +libpt-bintols = { workspace = true } +libpt-hedu = { workspace = true } +libpt-log = { workspace = true } +libpt-math = { workspace = true } +libpt-ccc = { workspace = true } +libpt-net = { workspace = true } +clap = { version = "4.4.4", features = ["derive"], optional = true } +clap-num = { version = "1.0.2", optional = true } +clap-verbosity-flag = { version = "2.0.1", optional = true } diff --git a/members/libpt-bin/Cargo.toml b/members/libpt-bin/Cargo.toml deleted file mode 100644 index a0cd981..0000000 --- a/members/libpt-bin/Cargo.toml +++ /dev/null @@ -1,41 +0,0 @@ -[package] -autobins = true -name = "libpt-bin" -publish.workspace = true -version.workspace = true -edition.workspace = true -authors.workspace = true -license.workspace = true -description.workspace = true -readme.workspace = true -homepage.workspace = true -repository.workspace = true -keywords.workspace = true -categories.workspace = true - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[[bin]] -name = "ccc" -path = "src/ccc/mod.rs" - -[[bin]] -name = "hedu" -path = "src/hedu/mod.rs" - -[[bin]] -name = "libpt" -path = "src/main/mod.rs" - -[dependencies] -clap = { version = "4.4.4", features = ["derive"] } -clap-num = "1.0.2" -clap-verbosity-flag = "2.0.1" -libpt = { version = "0.2.0-alpha.2", path = "../..", features = [ - "default", - "ccc", - "math", - "hedu", - "net", - "log", -], registry = "cscherr" } diff --git a/members/libpt-bintols/Cargo.toml b/members/libpt-bintols/Cargo.toml index 3d0ca88..668a1a6 100644 --- a/members/libpt-bintols/Cargo.toml +++ b/members/libpt-bintols/Cargo.toml @@ -16,5 +16,7 @@ categories.workspace = true [dependencies] num-traits = "0.2.16" -libpt-core = { version = "0.2.0-alpha.2", path = "../libpt-core", registry="cscherr" } -libpt-log = { version = "0.2.0-alpha.2", path = "../libpt-log", registry="cscherr" } +libpt-core = { workspace = true } +libpt-log = { workspace = true } +anyhow = { workspace = true } +thiserror = { workspace = true } diff --git a/members/libpt-hedu/src/lib.rs b/members/libpt-bintols/src/hedu/mod.rs similarity index 100% rename from members/libpt-hedu/src/lib.rs rename to members/libpt-bintols/src/hedu/mod.rs diff --git a/members/libpt-ccc/Cargo.toml b/members/libpt-ccc/Cargo.toml deleted file mode 100644 index 4c47bdd..0000000 --- a/members/libpt-ccc/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "libpt-ccc" -publish.workspace = true -version.workspace = true -edition.workspace = true -authors.workspace = true -license.workspace = true -description.workspace = true -readme.workspace = true -homepage.workspace = true -repository.workspace = true -keywords.workspace = true -categories.workspace = true - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -num = "0.4.1" -num-traits = "0.2.16" -libpt-core = { version = "0.2.0-alpha.2", path = "../libpt-core", registry="cscherr" } -libpt-log = { version = "0.2.0-alpha.2", path = "../libpt-log", registry="cscherr" } -libpt-math = { version = "0.2.0-alpha.2", path = "../libpt-math", registry="cscherr" } diff --git a/members/libpt-core/Cargo.toml b/members/libpt-core/Cargo.toml index a2b89c9..cacd5b9 100644 --- a/members/libpt-core/Cargo.toml +++ b/members/libpt-core/Cargo.toml @@ -15,4 +15,4 @@ categories.workspace = true [dependencies] anyhow = "1.0.79" cucumber = "0.20.2" -libpt-log = { version = "0.2.0-alpha.2", path = "../libpt-log", registry="cscherr" } +libpt-log = { workspace = true } diff --git a/members/libpt-hedu/Cargo.toml b/members/libpt-hedu/Cargo.toml deleted file mode 100644 index 1247caf..0000000 --- a/members/libpt-hedu/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "libpt-hedu" -publish.workspace = true -version.workspace = true -edition.workspace = true -authors.workspace = true -license.workspace = true -description.workspace = true -readme.workspace = true -homepage.workspace = true -repository.workspace = true -keywords.workspace = true -categories.workspace = true - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -anyhow = { workspace = true } -thiserror = { workspace = true } -libpt-log = { version = "0.2.0-alpha.2", path = "../libpt-log", registry="cscherr" } -libpt-bintols = { version = "0.2.0-alpha.2", path = "../libpt-bintols", registry="cscherr" } diff --git a/members/libpt-math/Cargo.toml b/members/libpt-math/Cargo.toml index 343800c..34b56d1 100644 --- a/members/libpt-math/Cargo.toml +++ b/members/libpt-math/Cargo.toml @@ -15,3 +15,7 @@ categories.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +num = "0.4.1" +num-traits = "0.2.16" +libpt-core = { workspace = true } +libpt-log = { workspace = true } diff --git a/members/libpt-ccc/src/lib.rs b/members/libpt-math/src/ccc/mod.rs similarity index 100% rename from members/libpt-ccc/src/lib.rs rename to members/libpt-math/src/ccc/mod.rs diff --git a/members/libpt-net/Cargo.toml b/members/libpt-net/Cargo.toml index 43d80f1..4a4e4bf 100644 --- a/members/libpt-net/Cargo.toml +++ b/members/libpt-net/Cargo.toml @@ -16,9 +16,9 @@ categories.workspace = true [dependencies] humantime = "2.1.0" -libpt-core = { version = "0.2.0-alpha.2", path = "../libpt-core", registry="cscherr" } -libpt-log = { version = "0.2.0-alpha.2", path = "../libpt-log", registry="cscherr" } -libpt-math = { version = "0.2.0-alpha.2", path = "../libpt-math", registry="cscherr" } +libpt-core = { workspace = true } +libpt-log = { workspace = true } +libpt-math = { workspace = true } reqwest = { version = "0.11.20", features = ["blocking"] } serde = { version = "1.0.188", features = ["serde_derive"] } serde_json = "1.0.107" diff --git a/members/libpt-bin/src/ccc/mod.rs b/src/ccc/mod.rs similarity index 100% rename from members/libpt-bin/src/ccc/mod.rs rename to src/ccc/mod.rs diff --git a/members/libpt-bin/src/hedu/mod.rs b/src/hedu/mod.rs similarity index 100% rename from members/libpt-bin/src/hedu/mod.rs rename to src/hedu/mod.rs diff --git a/members/libpt-bin/src/main/args.rs b/src/main/args.rs similarity index 100% rename from members/libpt-bin/src/main/args.rs rename to src/main/args.rs diff --git a/members/libpt-bin/src/main/mod.rs b/src/main/mod.rs similarity index 100% rename from members/libpt-bin/src/main/mod.rs rename to src/main/mod.rs