-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
build.rs
31 lines (29 loc) · 1.02 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
use vergen_git2::{Emitter, Git2Builder};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// set VERGEN_GIT_SHA env variable based on git commit hash
let git2 = Git2Builder::default().branch(true).sha(true).build()?;
Emitter::default().add_instructions(&git2)?.emit()?;
let mut config = prost_build::Config::new();
config.protoc_arg("--experimental_allow_proto3_optional");
tonic_build::configure().compile_with_config(
config,
&[
"proto/core/auth.proto",
"proto/core/proxy.proto",
"proto/core/vpn.proto",
"src/enterprise/proto/license.proto",
"proto/worker/worker.proto",
"proto/wireguard/gateway.proto",
],
&[
"proto/core",
"proto/worker",
"proto/wireguard",
"src/enterprise/proto",
],
)?;
println!("cargo:rerun-if-changed=migrations");
println!("cargo:rerun-if-changed=proto");
println!("cargo:rerun-if-changed=web/dist");
Ok(())
}