2020-10-15 17:04:10 -07:00
|
|
|
fn main() -> Result<(), std::io::Error> {
|
2021-07-10 12:50:55 -07:00
|
|
|
let proto_base_path = std::path::PathBuf::from("proto");
|
|
|
|
let proto_files = ["confirmed_block.proto", "transaction_by_addr.proto"];
|
|
|
|
let mut protos = Vec::new();
|
|
|
|
for proto_file in &proto_files {
|
|
|
|
let proto = proto_base_path.join(proto_file);
|
|
|
|
println!("cargo::rerun-if-changed={}", proto.display());
|
|
|
|
protos.push(proto);
|
|
|
|
}
|
2020-10-15 17:04:10 -07:00
|
|
|
|
|
|
|
tonic_build::configure()
|
|
|
|
.build_client(true)
|
|
|
|
.build_server(false)
|
|
|
|
.format(true)
|
2021-07-10 12:50:55 -07:00
|
|
|
.compile(&protos, &[proto_base_path])
|
2020-10-15 17:04:10 -07:00
|
|
|
}
|