Browse Source

buf: modify buf.yml, add buf generate (#5653)

pull/5676/head
Marko 4 years ago
committed by GitHub
parent
commit
39e81807a3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 14 deletions
  1. +13
    -0
      buf.gen.yaml
  2. +2
    -0
      buf.yaml
  3. +1
    -14
      scripts/protocgen.sh

+ 13
- 0
buf.gen.yaml View File

@ -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

+ 2
- 0
buf.yaml View File

@ -1,3 +1,5 @@
version: v1beta1
build: build:
roots: roots:
- proto - proto


+ 1
- 14
scripts/protocgen.sh View File

@ -2,20 +2,7 @@
set -eo pipefail 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 mv ./proto/tendermint/abci/types.pb.go ./abci/types


Loading…
Cancel
Save