2024-03-09 18:45:32 +01:00
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
2024-09-30 23:51:33 +02:00
|
|
|
let server = {
|
|
|
|
#[cfg(feature = "server")] { true }
|
|
|
|
#[cfg(not(feature = "server"))] { false }
|
|
|
|
};
|
|
|
|
|
|
|
|
let client = {
|
|
|
|
#[cfg(feature = "client")] { true }
|
|
|
|
#[cfg(not(feature = "client"))] { false }
|
|
|
|
};
|
|
|
|
|
|
|
|
let transport = {
|
|
|
|
#[cfg(any(feature = "server", feature = "client"))] { true }
|
|
|
|
#[cfg(not(any(feature = "server", feature = "client")))] { false }
|
|
|
|
};
|
|
|
|
|
|
|
|
Ok
|
|
|
|
(tonic_build::configure()
|
|
|
|
.build_server(server)
|
|
|
|
.build_client(client)
|
|
|
|
.build_transport(transport)
|
|
|
|
.compile_protos(
|
|
|
|
&[
|
|
|
|
"proto/common.proto",
|
|
|
|
"proto/cursor.proto",
|
|
|
|
"proto/files.proto",
|
|
|
|
"proto/auth.proto",
|
|
|
|
"proto/session.proto",
|
|
|
|
"proto/workspace.proto",
|
|
|
|
"proto/buffer.proto",
|
|
|
|
],
|
|
|
|
&["proto"],
|
|
|
|
)?)
|
2024-03-09 19:07:23 +01:00
|
|
|
}
|