2020-12-07 20:32:02 +00:00
|
|
|
fn main() {
|
2020-12-08 08:47:34 +00:00
|
|
|
let mut config = prost_build::Config::new();
|
2020-12-31 22:21:05 +00:00
|
|
|
config.btree_map(&["."]);
|
2020-12-08 08:47:34 +00:00
|
|
|
config.type_attribute(".", "#[derive(Serialize)]");
|
|
|
|
config.type_attribute(".", "#[serde(rename_all = \"camelCase\")]");
|
2021-01-02 21:26:09 +00:00
|
|
|
// config
|
|
|
|
// .compile_protos(
|
|
|
|
// &["proto/cofd.proto", "proto/cofd_api.proto"],
|
|
|
|
// &["src/", "proto/"],
|
|
|
|
// )
|
|
|
|
// .unwrap();
|
|
|
|
|
|
|
|
tonic_build::configure()
|
|
|
|
.build_server(true)
|
|
|
|
.build_client(false)
|
|
|
|
.compile_with_config(
|
|
|
|
config,
|
2020-12-27 21:03:10 +00:00
|
|
|
&["proto/cofd.proto", "proto/cofd_api.proto"],
|
|
|
|
&["src/", "proto/"],
|
|
|
|
)
|
2020-12-08 08:47:34 +00:00
|
|
|
.unwrap();
|
2020-12-07 20:32:02 +00:00
|
|
|
}
|