Custom options <https://developers.google.com/protocol-buffers/docs/proto#customoptions> feel like the natural place to store data for consumption by another plugin. I'm not sure if the plugin interface will let you do this all in one protoc invocation, but maybe it would make sense to split up into multiple steps. You could generate the descriptors with --descriptor_set_out, then modify them to add whatever kind of special data you want via custom options, and then finally invoke protoc again by passing the modified descriptors in --descriptor_set_in.
On Thu, Dec 17, 2020 at 9:46 AM Nadav Samet <[email protected]> wrote: > Are there any mechanisms provided by protoc that would allow one protoc > plugin to provide data (not file content) that can be consumed by a > subsequent protoc plugin on the same protoc run? I want to be able to give > users of my plugin a way to control the output of the main plugin based on > logic that they would program into their own plugin. The output of that > logic would be consumed by the main plugin and impact its behavior (for > example, modify field names and types). Alternatives could be communicating > through the filesystem/pipes, or developing a sub-plugin framework under my > own plugin - which aren't ideal. > > Thanks, > -Nadav > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/protobuf/CANZcNEo1HD1W5V4-NQ8Jt0v%3DKy2Bif%2BuZOV%3DHPGxxaV_VYDnAQ%40mail.gmail.com > <https://groups.google.com/d/msgid/protobuf/CANZcNEo1HD1W5V4-NQ8Jt0v%3DKy2Bif%2BuZOV%3DHPGxxaV_VYDnAQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/CADqAXr5qJov9agJz_sVMr8Zxj--VSatdGRDVamUPaCWEX8dFSA%40mail.gmail.com.
