From 39e81807a37c39240f3c7357cfeeb46dcc3fab84 Mon Sep 17 00:00:00 2001 From: Marko Date: Tue, 17 Nov 2020 10:30:35 +0100 Subject: [PATCH] buf: modify buf.yml, add buf generate (#5653) --- buf.gen.yaml | 13 +++++++++++++ buf.yaml | 2 ++ scripts/protocgen.sh | 15 +-------------- 3 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 buf.gen.yaml diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 000000000..dc56781dd --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,13 @@ +# The version of the generation template. +# Required. +# The only currently-valid value is v1beta1. +version: v1beta1 + +# The plugins to run. +plugins: + # The name of the plugin. + - name: gogofaster + # The the relative output directory. + out: proto + # Any options to provide to the plugin. + opt: Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,plugins=grpc,paths=source_relative diff --git a/buf.yaml b/buf.yaml index d21611209..cc4aced57 100644 --- a/buf.yaml +++ b/buf.yaml @@ -1,3 +1,5 @@ +version: v1beta1 + build: roots: - proto diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 16f0ec733..51b1cc6d3 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -2,20 +2,7 @@ set -eo pipefail -proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) -for dir in $proto_dirs; do - buf protoc \ - -I "proto" \ - -I "third_party/proto" \ - --gogofaster_out=\ -Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\ -Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,\ -plugins=grpc,paths=source_relative:. \ - $(find "${dir}" -maxdepth 1 -name '*.proto') -done - -cp -r ./tendermint/* ./proto/* -rm -rf tendermint +buf generate --path proto/tendermint mv ./proto/tendermint/abci/types.pb.go ./abci/types