fix(build): Allow creating multiple services in the same package (#173)

BREAKING CHANGE: Build will now generate each service client and server into their own modules.
This commit is contained in:
Lucio Franco
2019-12-11 16:22:03 -05:00
committed by GitHub
parent 393a57eade
commit 0847b67c4e
21 changed files with 115 additions and 110 deletions
+2 -14
View File
@@ -251,13 +251,7 @@ impl prost_build::ServiceGenerator for ServiceGenerator {
let clients = &self.clients;
let client_service = quote::quote! {
/// Generated client implementations.
pub mod client {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
#clients
}
#clients
};
let code = format!("{}", client_service);
@@ -270,13 +264,7 @@ impl prost_build::ServiceGenerator for ServiceGenerator {
let servers = &self.servers;
let server_service = quote::quote! {
/// Generated server implementations.
pub mod server {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
#servers
}
#servers
};
let code = format!("{}", server_service);