-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
36 lines (28 loc) · 741 Bytes
/
build.rs
File metadata and controls
36 lines (28 loc) · 741 Bytes
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
#![allow(non_snake_case)]
use serde::Deserialize;
#[derive(Deserialize)]
struct Toml {
package:Package,
}
#[derive(Deserialize)]
struct Package {
version:String,
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo:rerun-if-changed=Cargo.toml");
println!(
"cargo:rustc-env=CARGO_PKG_VERSION={}",
toml::from_str::<Toml>(&std::fs::read_to_string("Cargo.toml").expect("Cannot Cargo.toml."))
.expect("Cannot toml.")
.package
.version
);
println!("cargo:rerun-if-changed=Proto/Air.proto");
tonic_prost_build::configure()
.build_server(true)
.build_client(true)
.out_dir("Source/Vine/Generated")
.compile_well_known_types(true)
.compile_protos(&["Proto/Air.proto"], &["Proto"])?;
Ok(())
}