You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

17 lines
504 B

use std::fs::read_dir;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut files = Vec::new();
for f in read_dir("../protobuf").unwrap() {
if let Ok(f) = f {
if f.path().is_file() && f.path().extension().map(|x| x == "proto").unwrap_or(false) {
files.push(f.path());
}
}
}
tonic_build::configure()
.build_client(false)
.out_dir("src/grpc")
.compile(&files, &["../protobuf".into()])?;
Ok(())
}