fn main() {
unsafe {
std::env::set_var("PROTOC", protoc_bin_vendored::protoc_bin_path().unwrap());
}
let mut config = prost_build::Config::new();
config.bytes(["."]);
config.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]");
config.field_attribute(
"RpcRequest.request_id",
"#[serde(with = \"crate::serde_helpers::uuid_string\")]",
);
config.field_attribute(
"RpcResponse.request_id",
"#[serde(with = \"crate::serde_helpers::uuid_string\")]",
);
config.field_attribute(
"RpcRequest.payload",
"#[serde(with = \"crate::serde_helpers::payload_flexible\")]",
);
config.field_attribute(
"RpcResponse.payload",
"#[serde(with = \"crate::serde_helpers::payload_flexible\")]",
);
config.field_attribute(
"InterfaceRegister.instance_id",
"#[serde(with = \"crate::serde_helpers::uuid_string\")]",
);
config.field_attribute(
"InterfaceDeregister.instance_id",
"#[serde(with = \"crate::serde_helpers::uuid_string\")]",
);
config
.compile_protos(&["proto/synapse.proto"], &["proto/"])
.expect("Failed to compile protobuf files");
println!("cargo:rerun-if-changed=proto/synapse.proto");
}