fn main() -> Result<(), Box<dyn std::error::Error>> {
if std::env::var("PROTOC").is_err()
&& let Ok(path) = protoc_bin_vendored::protoc_bin_path()
{
unsafe { std::env::set_var("PROTOC", path) };
}
println!("cargo:rerun-if-changed=proto/vectorizer.proto");
println!("cargo:rerun-if-changed=proto/cluster.proto");
std::fs::create_dir_all("src/grpc_gen")?;
tonic_prost_build::configure()
.build_server(true)
.build_client(true) .out_dir("src/grpc_gen")
.compile_protos(
&["proto/vectorizer.proto", "proto/cluster.proto"],
&["proto"],
)?;
println!("cargo:rerun-if-changed=proto/qdrant/");
std::fs::create_dir_all("src/grpc_gen/qdrant")?;
tonic_prost_build::configure()
.build_server(true)
.build_client(true)
.out_dir("src/grpc_gen/qdrant")
.compile_protos(
&[
"proto/qdrant/collections_service.proto",
"proto/qdrant/points_service.proto",
"proto/qdrant/snapshots_service.proto",
],
&["proto/qdrant"],
)?;
Ok(())
}