Skip to content

add a protoc_plugin:generate CLI #1034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

devoncarew
Copy link
Collaborator

This (WIP) PR adds a new CLI entrypoint to protoc_plugin to make it easier to generate the proto classes. It:

  • discovers the protoc binary
  • allows specifying the out directory
  • allows specifying multiple proto search path dirs
  • by default, automatically includes the google.protobuf protos (discovered from the protoc install path)
  • is invoked via dart run protoc_plugin:generate
A wrapper around protoc to make it easier to generate Dart code from protobuf definitions.

usage: dart run protoc_plugin:generate [options] <proto files>
-h, --help                      Print this usage information.
    --version                   Display the protoc version in use.
    --proto-path=<directory>    Specify the directories in which to search for imported protos.
    --out=<directory>           The output directory for the generated code.
                                (defaults to "lib/src/gen")
    --grpc                      Generate gRPC service classes.

This needs more work, docs, testing, and discussion, so starting as a draft PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant