Skip to content

Commit

Permalink
Generate proto code into out directory
Browse files Browse the repository at this point in the history
This avoids polluting the source tree.

Signed-off-by: Pascal Bach <[email protected]>
  • Loading branch information
bachp committed May 30, 2022
1 parent d1efa0e commit b14f805
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 668 deletions.
9 changes: 3 additions & 6 deletions k8s-deviceplugin/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
fn main() {
tonic_build::configure()
.build_server(false)
.out_dir("src")
.compile(
&["proto/v1beta1.proto", "proto/v1alpha.proto"],
&["proto"],
).unwrap();
.build_server(true)
.compile(&["proto/v1beta1.proto", "proto/v1alpha.proto"], &["proto"])
.unwrap();
}
260 changes: 0 additions & 260 deletions k8s-deviceplugin/src/deviceplugin.rs

This file was deleted.

4 changes: 2 additions & 2 deletions k8s-deviceplugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//!
pub mod v1beta1 {
include!("./v1beta1.rs");
tonic::include_proto!("v1beta1");

/// Means that the device is healthy.
pub const HEALTHY: &str = "Healthy";
Expand Down Expand Up @@ -67,7 +67,7 @@ pub mod v1beta1 {
}

pub mod v1alpha {
include!("./deviceplugin.rs");
tonic::include_proto!("deviceplugin");

/// Means that the device is healthy.
pub const HEALTHY: &str = "Healthy";
Expand Down
Loading

0 comments on commit b14f805

Please sign in to comment.