Skip to content

Commit b14f805

Browse files
committed
Generate proto code into out directory
This avoids polluting the source tree. Signed-off-by: Pascal Bach <[email protected]>
1 parent d1efa0e commit b14f805

File tree

4 files changed

+5
-668
lines changed

4 files changed

+5
-668
lines changed

k8s-deviceplugin/build.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
fn main() {
22
tonic_build::configure()
3-
.build_server(false)
4-
.out_dir("src")
5-
.compile(
6-
&["proto/v1beta1.proto", "proto/v1alpha.proto"],
7-
&["proto"],
8-
).unwrap();
3+
.build_server(true)
4+
.compile(&["proto/v1beta1.proto", "proto/v1alpha.proto"], &["proto"])
5+
.unwrap();
96
}

k8s-deviceplugin/src/deviceplugin.rs

-260
This file was deleted.

k8s-deviceplugin/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
//!
3535
3636
pub mod v1beta1 {
37-
include!("./v1beta1.rs");
37+
tonic::include_proto!("v1beta1");
3838

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

6969
pub mod v1alpha {
70-
include!("./deviceplugin.rs");
70+
tonic::include_proto!("deviceplugin");
7171

7272
/// Means that the device is healthy.
7373
pub const HEALTHY: &str = "Healthy";

0 commit comments

Comments
 (0)