diff --git a/Cargo.lock b/Cargo.lock index 8a81337..449046a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -169,9 +169,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.2" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0841812012b2d4a6145fae9a6af1534873c32aa67fff26bd09f8fa42c83f95a" +checksum = "21dc42e00223fc37204bd4aa177e69420c604ca4a183209a8f9de30c6d934698" dependencies = [ "bytes", "prost-derive", @@ -179,9 +179,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.1" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb" +checksum = "a3f8ad728fb08fe212df3c05169e940fbb6d9d16a877ddde14644a983ba2012e" dependencies = [ "bytes", "heck", @@ -190,18 +190,20 @@ dependencies = [ "log", "multimap", "petgraph", + "prettyplease", "prost", "prost-types", "regex", + "syn", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.11.2" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306" +checksum = "8bda8c0881ea9f722eb9629376db3d0b903b462477c1aafcb0566610ac28ac5d" dependencies = [ "anyhow", "itertools", @@ -212,9 +214,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.2" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747761bc3dc48f9a34553bf65605cf6cb6288ba219f3450b4275dbd81539551a" +checksum = "a5e0526209433e96d83d750dd81a99118edbc55739e7e61a46764fd2ad537788" dependencies = [ "bytes", "prost", diff --git a/protoc-gen-prost-crate/Cargo.toml b/protoc-gen-prost-crate/Cargo.toml index 1322cbc..1ef1118 100644 --- a/protoc-gen-prost-crate/Cargo.toml +++ b/protoc-gen-prost-crate/Cargo.toml @@ -16,8 +16,8 @@ categories = ["encoding"] [dependencies] once_cell = "1.10.0" -prost-build = { version = ">=0.11.0, <0.11.2", default-features = false } -prost-types = { version = "0.11.0", default-features = false } +prost-build = { version = "0.11.6", default-features = false } +prost-types = { version = "0.11.6", default-features = false } prost = { version = "0.11.0", default-features = false, features = ["std"] } protoc-gen-prost = { version = "0.2.0", path = "../protoc-gen-prost" } regex = { version = "1.5.5", default-features = false } diff --git a/protoc-gen-prost-serde/Cargo.toml b/protoc-gen-prost-serde/Cargo.toml index c2212ae..ed3f7de 100644 --- a/protoc-gen-prost-serde/Cargo.toml +++ b/protoc-gen-prost-serde/Cargo.toml @@ -16,8 +16,8 @@ categories = ["encoding"] [dependencies] pbjson-build = "0.5.1" -prost-build = { version = ">=0.11.0, <0.11.2", default-features = false } -prost-types = { version = "0.11.0", default-features = false } +prost-build = { version = "0.11.6", default-features = false } +prost-types = { version = "0.11.6", default-features = false } prost = { version = "0.11.0", default-features = false, features = ["std"] } protoc-gen-prost = { version = "0.2.0", path = "../protoc-gen-prost" } regex = { version = "1.5.5", default-features = false } diff --git a/protoc-gen-prost/Cargo.toml b/protoc-gen-prost/Cargo.toml index c63aeef..9f4a4b6 100644 --- a/protoc-gen-prost/Cargo.toml +++ b/protoc-gen-prost/Cargo.toml @@ -12,17 +12,15 @@ rust-version = "1.62" readme = "README.md" keywords = ["protobuf", "serialization", "prost"] categories = ["encoding"] -exclude = [ - "proto" -] +exclude = ["proto"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] once_cell = "1.10.0" -prost-build = { version = ">=0.11.0, <0.11.2", default-features = false } -prost-types = { version = "0.11.0", default-features = false } -prost = { version = "0.11.0", default-features = false, features = ["std"] } +prost-build = { version = "0.11.6", default-features = false } +prost-types = { version = "0.11.6", default-features = false } +prost = { version = "0.11.6", default-features = false, features = ["std"] } regex = { version = "1.5.5", default-features = false } [profile.release] diff --git a/protoc-gen-prost/src/lib.rs b/protoc-gen-prost/src/lib.rs index a85a40e..43fc5ba 100644 --- a/protoc-gen-prost/src/lib.rs +++ b/protoc-gen-prost/src/lib.rs @@ -219,6 +219,8 @@ struct ProstParameters { extern_path: Vec<(String, String)>, type_attribute: Vec<(String, String)>, field_attribute: Vec<(String, String)>, + enum_attribute: Vec<(String, String)>, + message_attribute: Vec<(String, String)>, compile_well_known_types: bool, retain_enum_prefix: bool, } @@ -244,6 +246,12 @@ impl ProstParameters { for (proto_path, attribute) in &self.field_attribute { config.field_attribute(proto_path, attribute); } + for (proto_path, attribute) in &self.enum_attribute { + config.enum_attribute(proto_path, attribute); + } + for (proto_path, attribute) in &self.message_attribute { + config.message_attribute(proto_path, attribute); + } if self.compile_well_known_types { config.compile_well_known_types(); @@ -323,6 +331,22 @@ impl ProstParameters { prefix.to_string(), module.replace(r"\,", ",").replace(r"\\", r"\"), )), + Param::KeyValue { + param: "enum_attribute", + key: prefix, + value: module, + } => self.enum_attribute.push(( + prefix.to_string(), + module.replace(r"\,", ",").replace(r"\\", r"\"), + )), + Param::KeyValue { + param: "message_attribute", + key: prefix, + value: module, + } => self.message_attribute.push(( + prefix.to_string(), + module.replace(r"\,", ",").replace(r"\\", r"\"), + )), _ => return Err(param), } diff --git a/protoc-gen-tonic/Cargo.toml b/protoc-gen-tonic/Cargo.toml index 93159b3..10c6381 100644 --- a/protoc-gen-tonic/Cargo.toml +++ b/protoc-gen-tonic/Cargo.toml @@ -11,17 +11,15 @@ edition = "2021" readme = "README.md" keywords = ["protobuf", "serialization", "prost", "grpc", "tonic"] categories = ["encoding"] -exclude = [ - "proto" -] +exclude = ["proto"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] heck = "0.4.0" prettyplease = "0.1.9" -prost-build = { version = ">=0.11.0, <0.11.2", default-features = false } -prost-types = { version = "0.11.0", default-features = false } +prost-build = { version = "0.11.6", default-features = false } +prost-types = { version = "0.11.6", default-features = false } prost = { version = "0.11.0", default-features = false, features = ["std"] } protoc-gen-prost = { version = "0.2.0", path = "../protoc-gen-prost" } regex = { version = "1.5.5", default-features = false }