2024-01-10 02:25:51 +01:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
use const_format::formatcp;
|
|
|
|
|
|
|
|
fn main() {
|
2024-01-11 20:40:17 +01:00
|
|
|
println!("cargo:rerun-if-changed=../api/protocol");
|
2024-01-10 02:25:51 +01:00
|
|
|
|
|
|
|
const VERSION: &str = "v0alpha1";
|
|
|
|
const PROTOS: &[&str] = &[
|
|
|
|
formatcp!("../api/protocol/pinnacle/{VERSION}/pinnacle.proto"),
|
|
|
|
formatcp!("../api/protocol/pinnacle/input/{VERSION}/input.proto"),
|
|
|
|
formatcp!("../api/protocol/pinnacle/output/{VERSION}/output.proto"),
|
|
|
|
formatcp!("../api/protocol/pinnacle/process/{VERSION}/process.proto"),
|
|
|
|
formatcp!("../api/protocol/pinnacle/tag/{VERSION}/tag.proto"),
|
|
|
|
formatcp!("../api/protocol/pinnacle/window/{VERSION}/window.proto"),
|
2024-02-22 01:08:23 +01:00
|
|
|
formatcp!("../api/protocol/pinnacle/signal/{VERSION}/signal.proto"),
|
2024-01-10 02:25:51 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
let descriptor_path = PathBuf::from(std::env::var("OUT_DIR").unwrap()).join("pinnacle.bin");
|
|
|
|
|
|
|
|
tonic_build::configure()
|
|
|
|
.file_descriptor_set_path(descriptor_path)
|
|
|
|
.compile(PROTOS, &["../api/protocol"])
|
|
|
|
.unwrap();
|
|
|
|
}
|