Skip to content

Commit

Permalink
chore: use tonic-build to compile proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
thynson committed Jul 9, 2024
1 parent 86f69f4 commit d82ebf5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 234 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ dotenvy = "0.15"

[dev-dependencies]
tracing-subscriber = { version = "0.3", features = ["default"] }
tonic-build = "0.10"
mockall = { version = "0.11" }

[build-dependencies]
tonic-build = "0.10"


[[example]]
name = "simple_app"
Expand Down
9 changes: 9 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use std::io::Result;

fn main() -> Result<()> {
tonic_build::configure()
.build_server(false)
.compile(&["proto/nacos_grpc_service.proto"], &["proto/"])?;

Ok(())
}
230 changes: 0 additions & 230 deletions src/_.rs

This file was deleted.

6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ mod config;
mod naming;

#[allow(dead_code)]
#[path = ""]
mod nacos_proto {
#[path = "_.rs"]
pub mod v2;
pub mod v2 {
tonic::include_proto!("_");
}
}

#[cfg(test)]
Expand Down

0 comments on commit d82ebf5

Please sign in to comment.