Skip to content

Commit

Permalink
Use buf for proto generation (#286)
Browse files Browse the repository at this point in the history
* Delete old generate code
* Add buf yaml files
* Update .proto files to use relative package paths
* Update proto generation docs
* Update example python plugin instructions
* Updated proto import path for example python plugin
* Update .gitignore rules
* Don't require embedded unimplemented structs
* Use BSR for all proto generation plugins
* buf generate
  • Loading branch information
tomhjp committed Oct 16, 2023
1 parent 5492ff9 commit 337cd57
Show file tree
Hide file tree
Showing 36 changed files with 3,017 additions and 1,932 deletions.
14 changes: 14 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

version: v1
plugins:
- plugin: buf.build/protocolbuffers/go
out: .
opt:
- paths=source_relative
- plugin: buf.build/grpc/go:v1.3.0
out: .
opt:
- paths=source_relative
- require_unimplemented_servers=false
7 changes: 7 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

version: v1
build:
excludes:
- examples/
4 changes: 1 addition & 3 deletions examples/bidirectional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ If you update the protocol buffers file, you can regenerate the file
using the following command from this directory. You do not need to run
this if you're just trying the example.

For Go:

```sh
$ protoc -I proto/ proto/kv.proto --go_out=plugins=grpc:proto/
$ buf generate
```
14 changes: 14 additions & 0 deletions examples/bidirectional/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

version: v1
plugins:
- plugin: buf.build/protocolbuffers/go
out: .
opt:
- paths=source_relative
- plugin: buf.build/grpc/go:v1.3.0
out: .
opt:
- paths=source_relative
- require_unimplemented_servers=false
4 changes: 4 additions & 0 deletions examples/bidirectional/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

version: v1
Loading

0 comments on commit 337cd57

Please sign in to comment.