use std::env;
use std::path::PathBuf;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let catalog_file = "./proto/catalog.proto";
let datum_file = "./proto/datum.proto";
let domain_file = "./proto/domain.proto";
let model_file = "./proto/model.proto";
let request_file = "./proto/request.proto";
let snapshot_file = "./proto/snapshot.proto";
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
tonic_build::configure()
.protoc_arg("--experimental_allow_proto3_optional") .build_client(true)
.build_server(true)
.file_descriptor_set_path(out_dir.join("proto_descriptor.bin"))
.out_dir("./src")
.compile(&[catalog_file, datum_file, domain_file, model_file, request_file, snapshot_file], &["proto"])?;
Ok(())
}