protobuf
protobuf copied to clipboard
Protoc Plugin support should allow custom parameters before other parameters
This applies only to the protoc CLI.
With some code generator toolchains (such as dotnet nuget), local tools get installed in a way that requires a call to a framework binary with the tool as the first parameter. For example, dotnet protoc-gen-fsharp
. However, you currently cannot tell protoc to put a custom argument before the others. It would be nice to be able to call such a command with leading arguments directly as the plugin input to protoc.
For dotnet nuget, we can install the tool globally which removes the need for dotnet
at the beginning, which is undesirable but the currently recommended solution. We could also deliver shell scripts, but that locks you into a specific shell dependency on the client. We could also deliver the plugin as a full fat executable, but that would involve shipping every possible runtime that people might use, greatly increasing the size of the package.
@marner2 Can you please include an example of a commandline that you run today and the improved version you'd like to write?
@googleberg current command line command (requires global tool install from nuget):
protoc-gen-fsharp --out=x ...[other args]
Improved version we'd like to write (can be installed locally):
dotnet protoc-gen-fsharp --out=x ...[other args]
From https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.compiler.command_line_interface#CommandLineInterface.AllowPlugins.details it says that the expected usage of the plugin is:
plugin [[]--out=OUTDIR] [[]--parameter=PARAMETER] PROTO_FILES < DESCRIPTORS
What we'd like is some way to specify additional args immediately after plugin
such as:
plugin PLUGIN_ARGS [[]--out=OUTDIR] [[]--parameter=PARAMETER] PROTO_FILES < DESCRIPTORS
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive
because the last activity was over 90 days ago.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.
This issue was closed and archived because there has been no new activity in the 14 days since the inactive
label was added.