Skip to content

Commit

Permalink
Support overriding the protos path
Browse files Browse the repository at this point in the history
  • Loading branch information
belak committed Dec 2, 2024
1 parent d7b96e4 commit 0955871
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
fn main() {
println!("cargo:rerun-if-changed=migrations");

let protos_path = std::env::var("SEABIRD_PROTO_PATH").unwrap_or_else(|_| "./proto".to_string());

// NOTE: we need to use configure rather than the simple case because both
// seabird and seabird_chat_ingest use the same package name. This also gives
// us the option to disable client generation so we do that.
tonic_build::configure()
.build_client(false)
.build_server(true)
.compile(
&["./proto/seabird.proto", "./proto/seabird_chat_ingest.proto"],
&["./proto"],
&["seabird.proto", "seabird_chat_ingest.proto"],
&[&protos_path],
)
.unwrap();
}

0 comments on commit 0955871

Please sign in to comment.