fn main() -> Result<(), Box<dyn std::error::Error>> {
    let proto_file = "../../proto/creditservice.proto";
    let protoc = protoc_bin_vendored::protoc_bin_path()?;
    std::env::set_var("PROTOC", protoc);

    tonic_build::configure()
        .build_server(true)
        .build_client(true)
        .compile_protos(&[proto_file], &["../../proto"])?;

    println!("cargo:rerun-if-changed={}", proto_file);
    Ok(())
}
