-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split grpc generated files into several
- Loading branch information
1 parent
f20f39d
commit 0f30a0f
Showing
6 changed files
with
202 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rpc_echo | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[[bin]] | ||
bench = false | ||
name = "gen" | ||
test = false | ||
|
||
[dependencies.pilota-build] | ||
version = "*" | ||
|
||
[dependencies.volo-build] | ||
workspace = true | ||
|
||
[package] | ||
edition = "2021" | ||
name = "code-generation-workspace-split" | ||
publish = false | ||
version = "0.0.0" | ||
|
||
[workspace] | ||
members = [] | ||
|
||
[workspace.dependencies] | ||
anyhow = "1" | ||
async-trait = "0.1" | ||
lazy_static = "1" | ||
serde = "1" | ||
volo-grpc = "*" | ||
|
||
[workspace.dependencies.pilota] | ||
version = "*" | ||
|
||
[workspace.dependencies.volo] | ||
path = "../../volo" | ||
|
||
[workspace.dependencies.volo-build] | ||
path = "../../volo-build" | ||
|
||
[workspace.dependencies.volo-thrift] | ||
path = "../../volo-thrift" |
15 changes: 15 additions & 0 deletions
15
tests/code-generation-workspace-split-grpc/proto/echo.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
syntax = "proto3"; | ||
|
||
package echo; | ||
|
||
message EchoRequest { | ||
string message = 1; | ||
} | ||
|
||
message EchoResponse { | ||
string message = 1; | ||
} | ||
|
||
service Echo { | ||
rpc Echo(EchoRequest) returns (EchoResponse) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use volo_build::plugin::SerdePlugin; | ||
|
||
fn main() { | ||
volo_build::workspace::Builder::protobuf() | ||
.plugin(SerdePlugin) | ||
.gen() | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/code-generation-workspace-split-grpc/volo.workspace.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
common_crate_name: "common" # common_crate_name = "common" by default | ||
touch_all: true | ||
dedups: [] # remove the repeated structure generation in one entry | ||
special_namings: [] | ||
split_generated_files: true | ||
# repos: # exsit if non-local | ||
# { repo }: # repo = extract the name from url by default | ||
# url: { git } # url = repo git url | ||
# ref: { ref } # ref = "HEAD" by default | ||
# lock: { commit hash } # lock is the last commit hash | ||
services: | ||
- idl: | ||
source: local | ||
path: proto/echo.proto | ||
includes: | ||
- proto | ||
codegen_option: | ||
touch: [] | ||
keep_unknown_fields: false # A->B->C, B could use this to transfer the unknown fields which is needed by A and C. | ||
config: | ||
crate_name: rpc_echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters