Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions grpc-protobuf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ allowed_external_types = [
bytes = "1.11.1"
grpc = { version = "0.10.0", path = "../grpc" }
protobuf = "4.35.1-release"
protobuf-well-known-types = "4.35.1-release"

[dev-dependencies]

[build-dependencies]
grpc-protobuf-build = { version = "0.10.0", path = "../grpc-protobuf-build", default-features = false }
protobuf-well-known-types = "4.35.1-release"
24 changes: 24 additions & 0 deletions grpc-protobuf/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use std::env;
use std::path::PathBuf;

fn main() {
println!("cargo:rerun-if-changed=build.rs");

println!("cargo:rerun-if-env-changed=GRPC_RUST_REGENERATE_PROTO");
if env::var_os("GRPC_RUST_REGENERATE_PROTO").is_some() {
let manifest_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
let dependencies = protobuf_well_known_types::get_dependency("protobuf_well_known_types")
.into_iter()
.map(|d| d.into())
.collect();

grpc_protobuf_build::CodeGen::new()
.output_dir(manifest_dir.join("generated"))
.include(manifest_dir.join("third_party/googleapis"))
.inputs(["google/rpc/status.proto"])
.dependencies(dependencies)
.client_only()
.compile()
.unwrap();
}
}
17 changes: 17 additions & 0 deletions grpc-protobuf/generated/google/rpc/generated.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#[path="status.u.pb.rs"]
#[allow(nonstandard_style, unused, unreachable_pub)]
#[doc(hidden)]
mod internal_do_not_use_google_srpc_sstatus;

#[allow(nonstandard_style, unused)]
#[doc(inline)]
pub use internal_do_not_use_google_srpc_sstatus::*;
#[allow(nonstandard_style, unused)]
pub mod __unstable {
pub static GOOGLE_RPC_STATUS_DESCRIPTOR_INFO: ::protobuf::__internal::runtime::__unstable::DescriptorInfo = ::protobuf::__internal::runtime::__unstable::DescriptorInfo {
descriptor: b"\n\x17google/rpc/status.proto\x12\ngoogle.rpc\x1a\x19google/protobuf/any.proto\"N\n\x06Status\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\x12%\n\x07\x64\x65tails\x18\x03 \x03(\x0b\x32\x14.google.protobuf.AnyB^\n\x0e\x63om.google.rpcB\x0bStatusProtoP\x01Z7google.golang.org/genproto/googleapis/rpc/status;status\xa2\x02\x03RPCb\x06proto3",
deps: &[
&::protobuf_well_known_types::__unstable::GOOGLE_PROTOBUF_ANY_DESCRIPTOR_INFO,
],
};
}
Loading
Loading