From 3bf2348b1adefccc38ca8b69520c41541ed01aaf Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Fri, 8 Aug 2025 07:31:40 +0200 Subject: build(proto): tonic-prost build script --- lib/warden-core/Cargo.toml | 13 +++++++++++++ lib/warden-core/build.rs | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 lib/warden-core/build.rs (limited to 'lib') diff --git a/lib/warden-core/Cargo.toml b/lib/warden-core/Cargo.toml index f10b5ea..efb61a3 100644 --- a/lib/warden-core/Cargo.toml +++ b/lib/warden-core/Cargo.toml @@ -7,4 +7,17 @@ homepage.workspace = true documentation.workspace = true description.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] +prost = { workspace = true, optional = true } +tonic = { workspace = true, optional = true } +tonic-types = { version = "0.14.0", optional = true } + +[features] +default = ["dep:prost", "dep:tonic", "dep:tonic-types"] + +[build-dependencies] +tonic-prost-build = { version = "0.14.0", features = ["cleanup-markdown"] } diff --git a/lib/warden-core/build.rs b/lib/warden-core/build.rs new file mode 100644 index 0000000..024e9bb --- /dev/null +++ b/lib/warden-core/build.rs @@ -0,0 +1,11 @@ +fn main() -> Result<(), Box> { + tonic_prost_build::configure() + .build_server(false) + //.out_dir("src/google") // you can change the generated code's location + .protoc_arg("-I=../..") + .compile_protos( + &["proto/googleapis/google/pubsub/v1/pubsub.proto"], + &["../../proto/googleapis"], // specify the root location to search proto dependencies + )?; + Ok(()) +} -- cgit v1.2.3