mirror of
https://codeberg.org/JasterV/granc.git
synced 2026-04-26 18:40:05 +00:00
24 lines
710 B
Rust
24 lines
710 B
Rust
use std::env::var;
|
|
use std::io::Result;
|
|
|
|
fn main() -> Result<()> {
|
|
// List of proto files containing a message definition
|
|
let proto_files = &[
|
|
// Services
|
|
"proto/echo.proto",
|
|
];
|
|
|
|
// Name of the folder containing the proto definitions
|
|
let proto_folder = "proto";
|
|
let out_dir = var("OUT_DIR").expect("Missing OUT_DIR environment variable");
|
|
let descriptors_path = format!("{}/descriptors.bin", out_dir);
|
|
|
|
tonic_prost_build::configure()
|
|
.file_descriptor_set_path(descriptors_path)
|
|
.protoc_arg("--experimental_allow_proto3_optional")
|
|
.build_client(false)
|
|
.compile_protos(proto_files, &[proto_folder])
|
|
.unwrap();
|
|
|
|
Ok(())
|
|
}
|