diff --git a/build.rs b/build.rs index e044c83..a33719e 100644 --- a/build.rs +++ b/build.rs @@ -1,8 +1,15 @@ fn main() -> Result<(), Box> { - tonic_build::compile_protos("proto/model/cursor.proto")?; - tonic_build::compile_protos("proto/model/user.proto")?; - tonic_build::compile_protos("proto/buffer_service.proto")?; - tonic_build::compile_protos("proto/cursor_service.proto")?; - tonic_build::compile_protos("proto/workspace_service.proto")?; + tonic_build::configure() + .build_server(false) + .compile( + &[ + "proto/model/cursor.proto", + "proto/model/user.proto", + "proto/buffer_service.proto", + "proto/cursor_service.proto", + "proto/workspace_service.proto" + ], + &["proto", "proto", "proto","proto", "proto"] + )?; Ok(()) -} + } \ No newline at end of file diff --git a/proto/cursor_service.proto b/proto/cursor_service.proto index a9fa0bc..cdeb88d 100644 --- a/proto/cursor_service.proto +++ b/proto/cursor_service.proto @@ -1,8 +1,8 @@ syntax = "proto2"; package codemp.cursor_service; -import "proto/model/cursor.proto"; -import "proto/model/user.proto"; +import "model/cursor.proto"; +import "model/user.proto"; // handle cursor events and broadcast to all users service Cursor { diff --git a/proto/model/cursor.proto b/proto/model/cursor.proto index d9a4666..1f2ddb1 100644 --- a/proto/model/cursor.proto +++ b/proto/model/cursor.proto @@ -2,7 +2,7 @@ syntax = "proto2"; package codemp.model.cursor; -import "proto/model/user.proto"; +import "model/user.proto"; // empty request message MovedResponse {} diff --git a/proto/model/user.proto b/proto/model/user.proto index 9c37484..4cb0f78 100644 --- a/proto/model/user.proto +++ b/proto/model/user.proto @@ -4,11 +4,7 @@ package codemp.model.user; // payload identifying user -message UserIdentity { +message UserIdentity{ // user identifier required string id = 1; } - -service User{ - -} \ No newline at end of file diff --git a/proto/workspace_service.proto b/proto/workspace_service.proto index 9d4a7a1..feffa91 100644 --- a/proto/workspace_service.proto +++ b/proto/workspace_service.proto @@ -25,7 +25,7 @@ syntax = "proto2"; package codemp.workspace_service; -import "proto/model/user.proto"; +import "model/user.proto"; message Empty {} diff --git a/src/lib.rs b/src/lib.rs index 3345a0e..f45287a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -165,8 +165,11 @@ pub use woot; #[cfg(feature = "proto")] #[allow(non_snake_case)] pub mod proto { - tonic::include_proto!("codemp.buffer"); - tonic::include_proto!("codemp.cursor"); + tonic::include_proto!("codemp.model.cursor"); + tonic::include_proto!("codemp.model.user"); + tonic::include_proto!("codemp.buffer_service"); + tonic::include_proto!("codemp.cursor_service"); + tonic::include_proto!("codemp.workspace_service"); }