protobuild
protobuild copied to clipboard
Proposal to allow multiple service interface implementations for a single .proto
Support generation of multiple service interface code implementations via different plugins from a single .proto. A user should be able to target a specific .proto and specify the plugin, and resulting import package location which provides the target directory for any generated code as well as the package name. It is the users responsibility to prevent collisions between the multiple plugins.
One use-case of this feature would be to generate ttrpc and grpc service implementations for a given .proto service defintiion.
An experiment was perfomed to see what could be possible with minimal modifications to Protobuild while leveraging the capabilities of protoc and the existing generators. By providing arguments for the import path, and output directory, protoc can be controlled to generate what is needed.
Do you have details of the proposal? An example configuration file?
@fraenkel Would these generate the ttrpc and grpc definitions to separate packages or the same package?
Had to go track this down since its been a while. It started from https://github.com/containerd/containerd/pull/2475 and I have a branch, https://github.com/fraenkel/protobuild/tree/relative_outputs TBH, I don't know how far I got since it all went silent.