github.com/stackb/rules_proto@v0.0.0-20240221195024-5428336c51f1/docs/plugins.md (about)

     1  ---
     2  layout: default
     3  title: Plugins
     4  permalink: plugins
     5  has_children: true
     6  nav_order: 4
     7  ---
     8  
     9  # Plugins
    10  
    11  The work `plugins` refers to both *protoc plugins* (standalone binary tool that
    12  communicate with the protoc tool over stdin/stdout) or *gazelle plugin* (go
    13  implementation of the `Plugin` interface).  The latter is used by gazelle to
    14  predict what files will be generated by the former.
    15  
    16  Gazelle protobuf plugins are installed into a global registry via a golang
    17  `init()` function.
    18  
    19  Naming of plugins is reminiscent of maven coordinates.  The name is just a
    20  string, but by convention it should follow the pattern `OWNER:REPO:TOOL`.  For
    21  example, the `protoc-gen-mypy` tool that exists in the repo at
    22  <https://github.com/dropbox/mypy-protobuf> would have the name
    23  `dropbox:mypy-protobuf:protoc-gen-mypy`.  The top-level domain is not used.
    24  
    25  ## Built-in plugins
    26  
    27  These plugins are part of the `protoc` tool itself, no additional plugins or
    28  dependencies are required.
    29  
    30  | plugin name          | description                              |
    31  | -------------------- | ---------------------------------------- |
    32  | `builtin:java`       | Mirrors `--java_out`                     |
    33  | `builtin:cpp`        | Mirrors `--cpp_out`                      |
    34  | `builtin:python`     | Mirrors `--python_out`                   |
    35  | `builtin:objc`       | Mirrors `--objc_out`                     |
    36  | `builtin:php`        | Mirrors `--php_out`                      |
    37  | `builtin:csharp`     | Mirrors `--csharp_out`                   |
    38  | `builtin:ruby`       | Mirrors `--ruby_out`                     |
    39  | `builtin:js:common`  | Mirrors `--js_out=import_style=commonjs` |
    40  | `builtin:js:closure` | Mirrors `--js_out=import_style=closure`  |
    41  
    42  ## Third-party plugins
    43  
    44  | plugin name                                           | description                                                                      |
    45  | ----------------------------------------------------- | -------------------------------------------------------------------------------- |
    46  | `gogo/protobuf/protoc-gen-combo`                      | Mirrors <https://github.com/gogo/protobuf/protoc-gen-gogo>                       |
    47  | `gogo/protobuf/protoc-gen-gogo`                       | Mirrors <https://github.com/gogo/protobuf/protoc-gen-gogo>                       |
    48  | `gogo/protobuf/protoc-gen-gogofast`                   | Mirrors <https://github.com/gogo/protobuf/protoc-gen-gogo>                       |
    49  | `gogo/protobuf/protoc-gen-gogofaster`                 | Mirrors <https://github.com/gogo/protobuf/protoc-gen-gogo>                       |
    50  | `gogo/protobuf/protoc-gen-gogoslick`                  | Mirrors <https://github.com/gogo/protobuf/protoc-gen-gogo>                       |
    51  | `gogo/protobuf/protoc-gen-gogotypes`                  | Mirrors <https://github.com/gogo/protobuf/protoc-gen-gogo>                       |
    52  | `gogo/protobuf/protoc-gen-gostring`                   | Mirrors <https://github.com/gogo/protobuf/protoc-gen-gogo>                       |
    53  | `grpc-ecosystem:grpc-gateway:protoc-gen-grpc-gateway` | Mirrors <https://github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway> |
    54  | `grpc-ecosystem:grpc-gateway:protoc-gen-openapiv2`    | Mirrors <https://github.com/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2>    |
    55  | `grpc:grpc-go:protoc-gen-go-grpc`                     | Mirrors <https://github.com/grpc/grpc-go/protoc-gen-go-grpc>                     |
    56  | `golang:protobuf:protoc-gen-go`                       | Mirrors <https://github.com/golang/protobuf/protoc-gen-go>                       |
    57  | `grpc:grpc-web:protoc-gen-grpc-web`                   | Mirrors <https://github.com/grpc/grpc-java/grpc_java_plugin>                     |
    58  | `grpc:grpc-java:protoc-gen-grpc-java`                 | Mirrors <https://github.com/grpc/grpc-java/grpc_java_plugin>                     |
    59  | `grpc:grpc:grpc_cpp_plugin`                           | Mirrors <https://github.com/grpc/grpc/grpc_cpp_plugin>                           |
    60  | `grpc:grpc:grpc_objc_plugin`                          | Mirrors <https://github.com/grpc/grpc/grpc_objc_plugin>                          |
    61  | `grpc:grpc:grpc_python_plugin`                        | Mirrors <https://github.com/grpc/grpc/grpc_python_plugin>                        |
    62  | `dropbox:mypy-protobuf:protoc-gen-mypy`               | Mirrors <https://github.com/dropbox/mypy-protobuf:protoc-gen-mypy>               |
    63  | `stackb:grpc.js:protoc-gen-grpcjs`                    | Mirrors <https://github.com/dropbox/mypy-protobuf:protoc-gen-mypy>               |
    64  | `protobufjs/protobuf.js:pbjs`*                        | Mirrors <https://github.com/protobufjs/protobuf.js/pbjs>                         |
    65  | `protobufjs/protobuf.js:pbts`*                        | Mirrors <https://github.com/protobufjs/protobuf.js/pbts>                         |
    66  
    67  * `pbjs` and `pbts` are not actual protoc plugins.  Rather, they are standalone
    68    tools that work in conjunction with the `protobufjs_compile` rule. 
    69  
    70  > TODO: Haskell, scala, d, dart, kotlin, android (protobuf-lite), other typescript, grpc-tools, rust.