-
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.
feat(volo-build): Split grpc generated files into several files (#540)
* Cleanup: better variable names in thrift_backend.rs * Split grpc generated files into several * Cleanup: move common functions from grpc_backend.rs and thrift_backend.rs to util.rs * Cleanup: cargo fmt * Cleanup: remove unused imports * Cleanup: imports order * Cleanup: imports order v2 * Cleanup: better variable names in thrift_backend.rs * Split grpc generated files into several * Cleanup: move common functions from grpc_backend.rs and thrift_backend.rs to util.rs * Cleanup: cargo fmt * Cleanup: remove unused imports * Cleanup: imports order * Cleanup: imports order v2 * Use streaming.proto for tests * Remove obsolete echo.proto
- Loading branch information
1 parent
0d39960
commit 03e22de
Showing
7 changed files
with
233 additions
and
68 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_streaming | ||
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-grpc" | ||
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" |
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: ../../examples/proto/streaming.proto | ||
includes: | ||
- ../../examples/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_streaming |
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
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
Oops, something went wrong.