2020-10-15 18:04:10 -06:00
|
|
|
fn main() -> Result<(), std::io::Error> {
|
|
|
|
let manifest_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
|
|
|
|
2021-07-09 14:06:06 -06:00
|
|
|
let out_dir = manifest_dir.join("proto");
|
|
|
|
let proto_files = manifest_dir.join("src");
|
|
|
|
|
|
|
|
std::fs::create_dir_all(out_dir.clone())?;
|
2020-10-15 18:04:10 -06:00
|
|
|
|
|
|
|
println!("Protobuf directory: {}", proto_files.display());
|
|
|
|
println!("output directory: {}", out_dir.display());
|
|
|
|
|
|
|
|
tonic_build::configure()
|
|
|
|
.build_client(true)
|
|
|
|
.build_server(false)
|
|
|
|
.format(true)
|
|
|
|
.out_dir(&out_dir)
|
2021-01-20 22:10:35 -08:00
|
|
|
.compile(
|
|
|
|
&[
|
|
|
|
proto_files.join("confirmed_block.proto"),
|
|
|
|
proto_files.join("transaction_by_addr.proto"),
|
|
|
|
],
|
|
|
|
&[proto_files],
|
|
|
|
)
|
2020-10-15 18:04:10 -06:00
|
|
|
}
|