From 7335c01f7deb3544b4c13df36813132ddc682e3c Mon Sep 17 00:00:00 2001 From: Geoffry Song Date: Thu, 29 Feb 2024 20:12:51 -0800 Subject: [PATCH] Add everything into a workspace --- Cargo.toml | 8 ++++++++ examples/examples_gen/Cargo.toml | 3 --- pb-jelly-gen/Cargo.toml | 4 ---- pb-jelly-gen/src/codegen.rs | 1 + pb-test/Cargo.toml | 5 +---- pb-test/gen/pb-jelly/proto_google/Cargo.toml.expected | 1 + pb-test/gen/pb-jelly/proto_nopackage/Cargo.toml.expected | 1 + pb-test/gen/pb-jelly/proto_pbtest/Cargo.toml.expected | 1 + pb-test/pb_test_gen/Cargo.toml | 6 +----- 9 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 Cargo.toml diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..7e19e52 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] +members = ["pb-jelly", "pb-jelly-gen", "pb-test", "pb-test/pb_test_gen", "examples/examples_gen"] +# Generated protos for examples aren't checked in, which interferes with the workspace +exclude = ["examples", "pb-test/gen/pb-jelly"] + +# Override pb-jelly dependency for generated crates as well +[patch.crates-io] +pb-jelly = { path = "pb-jelly" } diff --git a/examples/examples_gen/Cargo.toml b/examples/examples_gen/Cargo.toml index fea046e..0a8c3f6 100644 --- a/examples/examples_gen/Cargo.toml +++ b/examples/examples_gen/Cargo.toml @@ -8,6 +8,3 @@ publish = false [dependencies] #pb-jelly-gen = "0.0.16" # If copying this example - use this pb-jelly-gen = { path = "../../pb-jelly-gen" } - -[patch.crates-io] -pb-jelly = { path = "../../pb-jelly" } diff --git a/pb-jelly-gen/Cargo.toml b/pb-jelly-gen/Cargo.toml index 9cbf0cb..c1b8d18 100644 --- a/pb-jelly-gen/Cargo.toml +++ b/pb-jelly-gen/Cargo.toml @@ -26,7 +26,3 @@ walkdir = { version = "2", optional = true } pb-jelly = { version = "0.0.16" } lazy_static = "1.4.0" indexmap = "2.0.2" - -# Override pb-jelly dependency for generated crates as well -[patch.crates-io] -pb-jelly = { path = "../pb-jelly" } diff --git a/pb-jelly-gen/src/codegen.rs b/pb-jelly-gen/src/codegen.rs index f776a47..7081c7d 100644 --- a/pb-jelly-gen/src/codegen.rs +++ b/pb-jelly-gen/src/codegen.rs @@ -2637,6 +2637,7 @@ const CARGO_TOML_TEMPLATE: &str = concat!( name = "{crate}" version = "0.0.1" edition = "2018" +publish = false [dependencies] {deps} diff --git a/pb-test/Cargo.toml b/pb-test/Cargo.toml index f511321..51c3210 100644 --- a/pb-test/Cargo.toml +++ b/pb-test/Cargo.toml @@ -3,6 +3,7 @@ name = "pb-test" version = "0.1.0" authors = ["Rajat Goel ", "Nipunn Koorapati ", "Parker Timmerman "] edition = "2018" +publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -26,7 +27,3 @@ serde_json = "1" [features] bench_prost = ["prost"] bench_rust_protobuf = ["protobuf"] - -# Override pb-jelly dependency for generated crates as well -[patch.crates-io] -pb-jelly = { path = "../pb-jelly" } diff --git a/pb-test/gen/pb-jelly/proto_google/Cargo.toml.expected b/pb-test/gen/pb-jelly/proto_google/Cargo.toml.expected index 2a3a7f6..9e2e309 100644 --- a/pb-test/gen/pb-jelly/proto_google/Cargo.toml.expected +++ b/pb-test/gen/pb-jelly/proto_google/Cargo.toml.expected @@ -3,6 +3,7 @@ name = "proto_google" version = "0.0.1" edition = "2018" +publish = false [dependencies] lazy_static = { version = "1.4.0" } diff --git a/pb-test/gen/pb-jelly/proto_nopackage/Cargo.toml.expected b/pb-test/gen/pb-jelly/proto_nopackage/Cargo.toml.expected index 139fe9f..2dd3acd 100644 --- a/pb-test/gen/pb-jelly/proto_nopackage/Cargo.toml.expected +++ b/pb-test/gen/pb-jelly/proto_nopackage/Cargo.toml.expected @@ -3,6 +3,7 @@ name = "proto_nopackage" version = "0.0.1" edition = "2018" +publish = false [dependencies] lazy_static = { version = "1.4.0" } diff --git a/pb-test/gen/pb-jelly/proto_pbtest/Cargo.toml.expected b/pb-test/gen/pb-jelly/proto_pbtest/Cargo.toml.expected index aa30533..b02d0cc 100644 --- a/pb-test/gen/pb-jelly/proto_pbtest/Cargo.toml.expected +++ b/pb-test/gen/pb-jelly/proto_pbtest/Cargo.toml.expected @@ -3,6 +3,7 @@ name = "proto_pbtest" version = "0.0.1" edition = "2018" +publish = false [dependencies] bytes = { version = "1.0" } diff --git a/pb-test/pb_test_gen/Cargo.toml b/pb-test/pb_test_gen/Cargo.toml index 3ac00fe..7c96ecd 100644 --- a/pb-test/pb_test_gen/Cargo.toml +++ b/pb-test/pb_test_gen/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "examples_gen" +name = "pb_test_gen" version = "0.1.0" authors = ["Parker Timmerman "] edition = "2018" @@ -17,7 +17,3 @@ protobuf-codegen = { version = "3.3", optional = true } [features] bench_prost = ["prost-build"] bench_rust_protobuf = ["protobuf-codegen"] - -# Override pb-jelly dependency for generated crates as well -[patch.crates-io] -pb-jelly = { path = "../../pb-jelly" }