Plugins
The work plugins
refers to both protoc plugins (standalone binary tool that communicate with the protoc tool over stdin/stdout) or gazelle plugin (go implementation of the Plugin
interface). The latter is used by gazelle to predict what files will be generated by the former.
Gazelle protobuf plugins are installed into a global registry via a golang init()
function.
Naming of plugins is reminiscent of maven coordinates. The name is just a string, but by convention it should follow the pattern OWNER:REPO:TOOL
. For example, the protoc-gen-mypy
tool that exists in the repo at https://github.com/dropbox/mypy-protobuf would have the name dropbox:mypy-protobuf:protoc-gen-mypy
. The top-level domain is not used.
Built-in plugins
These plugins are part of the protoc
tool itself, no additional plugins or dependencies are required.
plugin name | description |
---|---|
builtin:java | Mirrors --java_out |
builtin:cpp | Mirrors --cpp_out |
builtin:python | Mirrors --python_out |
builtin:objc | Mirrors --objc_out |
builtin:php | Mirrors --php_out |
builtin:csharp | Mirrors --csharp_out |
builtin:ruby | Mirrors --ruby_out |
builtin:js:common | Mirrors --js_out=import_style=commonjs |
builtin:js:closure | Mirrors --js_out=import_style=closure |
Third-party plugins
pbjs
andpbts
are not actual protoc plugins. Rather, they are standalone tools that work in conjunction with theprotobufjs_compile
rule.
TODO: Haskell, scala, d, dart, kotlin, android (protobuf-lite), other typescript, grpc-tools, rust.