-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.rs
37 lines (31 loc) · 962 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
extern crate protobuf_codegen;
extern crate protoc_grpcio;
fn main() {
let proto_root = "proto";
let protos = ["storage.proto", "manage.proto"];
for proto in &protos {
println!("cargo:rerun-if-changed={}/{}", proto_root, proto);
}
let cust = protobuf_codegen::Customize { carllerche_bytes_for_bytes: Some(true), ..Default::default() };
protoc_grpcio::compile_grpc_protos(
&protos,
&[proto_root],
"storage-server/protocol",
Some(cust.clone()),
)
.expect("Failed to compile gRPC definitions!");
protoc_grpcio::compile_grpc_protos(
&protos,
&[proto_root],
"client/protocol",
Some(cust.clone()),
)
.expect("Failed to compile gRPC definitions!");
protoc_grpcio::compile_grpc_protos(
&protos,
&[proto_root],
"management-server/protocol",
Some(cust),
)
.expect("Failed to compile gRPC definitions!");
}