-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.rs
26 lines (24 loc) · 864 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
extern crate protobuf_codegen_pure;
fn main() {
protobuf_codegen_pure::Codegen::new()
.out_dir("./tests/protos")
.customize(protobuf_codegen_pure::Customize {
gen_mod_rs: Some(true),
..Default::default()
})
.inputs(&["./tests/protos/test.proto"])
.include("./tests/protos")
.run()
.expect("Failed to Codegen::run(test.proto)");
std::fs::create_dir_all("./src/protos").expect("Failed to create_dir_all : ./src/protos");
protobuf_codegen_pure::Codegen::new()
.out_dir("./src/protos")
.customize(protobuf_codegen_pure::Customize {
gen_mod_rs: Some(true),
..Default::default()
})
.inputs(&["./protos/message.proto"])
.include("./protos")
.run()
.expect("Failed Codegen::run(message.proto)");
}