You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update how code is generated from .proto files (#566)
* go get google.golang.org/genproto
* go get github.com/hashicorp/[email protected]
* go mod tidy
* Copy approach for generating code from proto files from hashicorp/terraform
* Add use of Go workspace to let Makefile run Go code in ./tools
* Fix to where code is generated to
* Update script to match the current version of protoc used
* switch to MPL-2.0 licensed version of this tool from Terraform v1.5
MPL licensed source: https://github.com/hashicorp/terraform/blob/7111fd1170c90b2b05aae61e7c89cc812dd7ca7b/tools/protobuf-compile/protobuf-compile.go
* re-adjust generation to plugin-go
Co-authored-by: Sarah French <[email protected]>
* Fix the terraform-provider-corner-tfprotov5 tests
* Fix the terraform-provider-corner-tfprotov6 tests
* Change how diffing GHA downloads protoc
* go mod download
* Update README
* Update description & instructions related to reusable proto files
* Remove `protoc` and `tools` targets in Makefile, simplify README
---------
Co-authored-by: Ansgar Mertens <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+2-9Lines changed: 2 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,16 +177,9 @@ Run `golangci-lint run ./...` or `make lint` after any changes.
177
177
178
178
### Protocol Updates
179
179
180
-
Ensure the following tooling is installed:
181
-
182
-
-[`protoc`](https://github.com/protocolbuffers/protobuf): Protocol Buffers compiler. This isn't Go specific tooling, so follow this [installation guide](https://github.com/protocolbuffers/protobuf#protobuf-compiler-installation)
183
-
- The Terraform Plugin Protocol uses well-known types (`Timestamp`), so be sure to copy the `include` directory to a folder included in your `PATH` (for example, on MacOS, `/usr/local/include`).
184
-
-[`protoc-gen-go`](https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go): Go plugin for Protocol Buffers compiler. Install by running `make tools`
185
-
-[`protoc-gen-go-grpc`](https://pkg.go.dev/google.golang.org/grpc/cmd/protoc-gen-go-grpc): Go gRPC plugin for Protocol Buffers compiler. Install by running `make tools`
186
-
187
-
The Protocol Buffers definitions can be found in `tfprotov5/internal/tfplugin5` and `tfprotov6/internal/tfplugin6`.
180
+
Run `make protobuf` to install the necessary tooling and to recompile the Protocol Buffers files after any changes.
188
181
189
-
Run`make protoc`to recompile the Protocol Buffers files after any changes.
182
+
The`make protobuf` command uses a script in `./tools/protobuf-compile`to compile the Go code using the Protocol Buffers defined in `tfprotov5/internal/tfplugin5` and `tfprotov6/internal/tfplugin6`. Before generating the code, the script will download `protoc` and build binaries for `protoc-gen-go` and `protoc-gen-go-grpc` using the Go toolchain. This tooling will be saved into a gitignored location in that directory, so it's easy to know which tooling versions are in use when making protocol changes.
0 commit comments