Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tonic-build in build.rs #232

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- run: sudo apt install -y protobuf-compiler libprotobuf-dev
- uses: actions/checkout@v3
- name: cargo fmt
run: cargo fmt -- --check --color ${{ env.CARGO_TERM_COLOR }}
Expand Down Expand Up @@ -49,6 +50,7 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- run: sudo apt install -y protobuf-compiler libprotobuf-dev
- uses: actions/checkout@v3
- name: Build
run: cargo build
Expand Down
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
29 changes: 0 additions & 29 deletions tests/proto_build.rs

This file was deleted.

Loading