Skip to content

Commit

Permalink
fix: simplified build script
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael-goetz committed Jul 31, 2024
1 parent f1f682f commit 009c03a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions build/rust/build.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
use std::io::Result;

fn main() -> Result<()> {
let internal_prefix = "../../internal";

let paths = &[
format!("{internal_prefix}/flow.proto"),
format!("{internal_prefix}/node.proto"),
format!("{internal_prefix}/rule.proto"),
format!("{internal_prefix}/type.proto"),
format!("{internal_prefix}/variable.proto")
"flow.proto",
"node.proto",
"rule.proto",
"type.proto",
"variable.proto"
];

tonic_build::configure()
.build_server(true)
.build_client(true)
.type_attribute("Variable", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Node", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Parameter", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Rule", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("RuleType", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Rule", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Type", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Parameter", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Node", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Flow", "#[derive(serde::Serialize, serde::Deserialize)]")
.protoc_arg("--proto_path=../../internal")
.compile(paths, &["src/lib.rs"])
.compile(paths, &["../../internal"])
.expect("Cannot compile protos");

Ok(())
Expand Down

0 comments on commit 009c03a

Please sign in to comment.