Files
tendermint/scripts/protocgen.sh
Erik Grinaker 66ed8ec39d proto: reorganize Protobuf schemas (#5102)
Reorganizes the Protobuf schemas. It is mostly bikeshedding, so if something is contentious or causes a lot of extra work then I'm fine with reverting. Some Protobuf and Go import paths will change.

* Move `abci/types/types.proto` to `abci/types.proto`.

* Move `crypto/keys/types.proto` and `crypto/merkle/types.proto` to `crypto/keys.proto` and `crypto/proof.proto`.

* Drop the use of `msgs` in filenames, as "message" is a very overloaded term (all Protobuf types are messages, and we also have `message Message`). Use `types.proto` as a catch-all, and otherwise name files by conceptual grouping instead of message kind.
2020-07-08 15:47:01 +00:00

23 lines
636 B
Bash
Executable File

#!/usr/bin/env bash
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
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
mv ./proto/tendermint/abci/types.pb.go ./abci/types
mv ./proto/tendermint/rpc/grpc/types.pb.go ./rpc/grpc