forked from containers/netavark-dhcp-proxy-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
40 lines (37 loc) · 1.75 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
extern crate core;
use std::path::{Path, PathBuf};
fn main() {
let builder = tonic_build::configure()
.type_attribute("netavark_proxy.Lease", "#[derive(serde::Serialize)]")
.type_attribute("netavark_proxy.DhcpV4Lease", "#[derive(serde::Serialize)]")
.type_attribute("netavark_proxy.DhcpV6Lease", "#[derive(serde::Serialize)]")
.type_attribute("netavark_proxy.IPResponse", "#[derive(serde::Serialize)]")
.type_attribute("netavark_proxy.MacAddress", "#[derive(serde::Serialize)]")
.type_attribute("netavark_proxy.NvIpv4Addr", "#[derive(serde::Serialize)]")
.type_attribute("netavark_proxy.Lease", "#[derive(serde::Deserialize)]")
.type_attribute(
"netavark_proxy.DhcpV4Lease",
"#[derive(serde::Deserialize)]",
)
.type_attribute(
"netavark_proxy.DhcpV6Lease",
"#[derive(serde::Deserialize)]",
)
.type_attribute("netavark_proxy.IPResponse", "#[derive(serde::Deserialize)]")
.type_attribute("netavark_proxy.MacAddress", "#[derive(serde::Deserialize)]")
.type_attribute("netavark_proxy.NvIpv4Addr", "#[derive(serde::Deserialize)]")
.type_attribute("netavark_proxy.MacAddress", "#[derive(Eq)]")
.type_attribute("netavark_proxy.MacAddress", "#[derive(Hash)]")
.type_attribute(
"netavark_proxy.NetworkConfig",
"#[derive(serde::Deserialize)]",
)
.type_attribute(
"netavark_proxy.NetworkConfig",
"#[derive(serde::Serialize)]",
)
.out_dir(PathBuf::from("proto-build"));
builder
.compile(&[Path::new("proto/proxy.proto")], &[Path::new("proto")])
.unwrap_or_else(|e| panic!("Failed at builder: {:?}", e.to_string()));
}