Files
arbiter/server/crates/arbiter-proto/build.rs
CleverWild fd46f8fb6e
Some checks failed
ci/woodpecker/pr/server-audit Pipeline was successful
ci/woodpecker/pr/server-lint Pipeline failed
ci/woodpecker/pr/server-vet Pipeline failed
ci/woodpecker/pr/server-test Pipeline was successful
fix(proto): build script
2026-03-26 21:25:38 +01:00

29 lines
943 B
Rust

use std::path::PathBuf;
use tonic_prost_build::{Config, configure};
static PROTOBUF_DIR: &str = "../../../protobufs";
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo::rerun-if-changed={PROTOBUF_DIR}");
let protoc_path = protoc_bin_vendored::protoc_bin_path()?;
let protoc_include = protoc_bin_vendored::include_path()?;
let mut config = Config::new();
config.protoc_executable(protoc_path);
let protos = [
PathBuf::from(format!("{}/arbiter.proto", PROTOBUF_DIR)),
PathBuf::from(format!("{}/user_agent.proto", PROTOBUF_DIR)),
PathBuf::from(format!("{}/client.proto", PROTOBUF_DIR)),
PathBuf::from(format!("{}/evm.proto", PROTOBUF_DIR)),
];
let includes = [PathBuf::from(PROTOBUF_DIR), protoc_include];
configure()
.message_attribute(".", "#[derive(::kameo::Reply)]")
.compile_with_config(config, &protos, &includes)?;
Ok(())
}