Skip to content

Commit

Permalink
fix: adjusted paths
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael-goetz committed Jul 31, 2024
1 parent 009c03a commit 2b8507a
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/java/build
build/java/.gradle
.idea
build/rust/target
build/rust/target
build/rust/src/internal/*
72 changes: 52 additions & 20 deletions build/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description = "The rust crate for the internal gRPC communication of Code0"
repository = "https://github.com/code0-tech/tucana"
homepage = "https://code0.tech"
license = "Apache-2.0"
include = ["src/internal/*"]

[dependencies]
tonic = "0.12.1"
Expand Down
17 changes: 8 additions & 9 deletions build/rust/build.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
use std::io::Result;

fn main() -> Result<()> {
let paths = &[
"flow.proto",
"node.proto",
"rule.proto",
"type.proto",
"variable.proto"
];

tonic_build::configure()
.out_dir("src/internal")
.build_server(true)
.build_client(true)
.type_attribute("Variable", "#[derive(serde::Serialize, serde::Deserialize)]")
Expand All @@ -19,7 +12,13 @@ fn main() -> Result<()> {
.type_attribute("Parameter", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Node", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute("Flow", "#[derive(serde::Serialize, serde::Deserialize)]")
.compile(paths, &["../../internal"])
.compile(&[
"variable.proto",
"rule.proto",
"type.proto",
"node.proto",
"flow.proto",
], &["../../internal"])
.expect("Cannot compile protos");

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion build/rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub mod internal {
tonic::include_proto!("internal");
include!("internal/internal.rs");
}

0 comments on commit 2b8507a

Please sign in to comment.