2023-01-03 13:54:06 +01:00
|
|
|
use prost_build::Config;
|
2023-05-30 16:12:21 +02:00
|
|
|
use vergen::EmitBuilder;
|
2023-01-03 13:54:06 +01:00
|
|
|
|
2022-12-12 12:19:14 +01:00
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
2023-05-30 16:12:21 +02:00
|
|
|
EmitBuilder::builder().git_sha(false).all_build().emit()?;
|
2023-01-23 16:05:24 +01:00
|
|
|
|
2023-07-20 15:50:09 +03:00
|
|
|
std::env::set_var("PROTOC", protobuf_src::protoc());
|
|
|
|
|
2023-01-03 13:54:06 +01:00
|
|
|
let mut config = Config::new();
|
2023-10-16 01:04:05 -07:00
|
|
|
config.bytes([".wal_log", ".proxy.ProgramReq.namespace"]);
|
2022-12-31 09:59:15 +02:00
|
|
|
tonic_build::configure()
|
|
|
|
.protoc_arg("--experimental_allow_proto3_optional")
|
2023-05-30 14:04:42 +02:00
|
|
|
.type_attribute(".proxy", "#[cfg_attr(test, derive(arbitrary::Arbitrary))]")
|
2023-08-10 16:55:31 +02:00
|
|
|
.field_attribute(".proxy.Value.data", "#[cfg_attr(test, arbitrary(with = crate::connection::write_proxy::test::arbitrary_rpc_value))]")
|
|
|
|
.field_attribute(".proxy.ProgramReq.namespace", "#[cfg_attr(test, arbitrary(with = crate::connection::write_proxy::test::arbitrary_bytes))]")
|
2023-01-03 13:54:06 +01:00
|
|
|
.compile_with_config(
|
|
|
|
config,
|
2023-02-13 17:36:49 +01:00
|
|
|
&["proto/replication_log.proto", "proto/proxy.proto"],
|
2023-01-03 13:54:06 +01:00
|
|
|
&["proto"],
|
|
|
|
)?;
|
2022-12-12 12:19:14 +01:00
|
|
|
|
|
|
|
println!("cargo:rerun-if-changed=proto");
|
|
|
|
|
|
|
|
Ok(())
|
2022-11-28 15:10:04 +01:00
|
|
|
}
|