use std::path::Path;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let root = if Path::new("proto").is_dir() {
"proto"
} else {
"../../proto"
};
println!("cargo:rerun-if-changed={root}");
let file = |name: &str| format!("{root}/kernable/v1/{name}");
let descriptors = protox::compile(
[
file("kernable.proto"),
file("storage.proto"),
file("replication.proto"),
file("export.proto"),
],
[root],
)?;
tonic_prost_build::configure()
.boxed(".kernable.v1.Rejected.requirement")
.compile_fds(descriptors)?;
Ok(())
}