use std::env;
use std::io::Result;
use std::path::PathBuf;
fn main() -> Result<()> {
let crate_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
let proto_dir = crate_dir.join("proto");
tonic_build::configure()
.build_server(false) .build_client(true)
.compile_well_known_types(true) .extern_path(".google.protobuf", "::prost_types") .compile_protos(
&[
proto_dir.join("google/rpc/status.proto"),
proto_dir.join("authzed/api/v1/permission_service.proto"),
proto_dir.join("authzed/api/v1/schema_service.proto"),
proto_dir.join("authzed/api/v1/watch_service.proto"),
proto_dir.join("authzed/api/v1/experimental_service.proto"),
],
&[&proto_dir], )?;
println!("cargo:rerun-if-changed={}", proto_dir.display());
Ok(())
}