cosmos-sdk/scripts/protocgen.sh

31 lines
962 B
Bash
Raw Normal View History

#!/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" \
--gocosmos_out=plugins=interfacetype+grpc,\
Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \
2020-05-15 07:57:20 -07:00
$(find "${dir}" -maxdepth 1 -name '*.proto')
Add Grpc gateway annotations (#6918) * grpc for bank module * edit module.go * added annotations for x/auth query proto * generated gw file * added grpc gateway for x/staking query proto * added annotations for evidence * added annotations for gov query proto * added annotations * added annotations for slashing module * updated annotations * added annotations for staking module * added annotations for upgrade query * annotations added for x/ibc/channel query proto * added annotations for ibc/connection query proto * updated annotations * updated annotations * annotation changes * ommitted ibc module * updated go.mod * fixed lint issue * review changes * review changes * review changes * review changes * go sum changes * updated annotations * annotation changes * Fix proto lint issues * review changes * review changes * review changes * discussion changes * review changes * grpc for bank module * edit module.go * added annotations for x/auth query proto * generated gw file * added grpc gateway for x/staking query proto * added annotations for evidence * added annotations for gov query proto * added annotations * added annotations for slashing module * updated annotations * added annotations for staking module * added annotations for upgrade query * annotations added for x/ibc/channel query proto * added annotations for ibc/connection query proto * updated annotations * updated annotations * annotation changes * ommitted ibc module * updated go.mod * fixed lint issue * review changes * review changes * review changes * review changes * go sum changes * updated annotations * annotation changes * Fix proto lint issues * review changes * review changes * review changes * discussion changes * review changes * fixed conflicts * review changes * updated gw files * lint * lint * lint * added missing annotations * review changes * review changes * review changes * review changes Co-authored-by: SaReN <sahithnarahari@gmail.com> Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
2020-08-14 03:05:35 -07:00
# command to generate gRPC gateway (*.pb.gw.go in respective modules) files
protoc \
-I "proto" \
-I "third_party/proto" \
--grpc-gateway_out=logtostderr=true:. \
$(find "${dir}" -maxdepth 1 -name '*.proto')
done
2020-07-01 08:26:29 -07:00
# generate codec/testdata proto code
protoc -I "proto" -I "third_party/proto" -I "testutil/testdata" --gocosmos_out=plugins=interfacetype+grpc,\
Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. ./testutil/testdata/proto.proto
2020-07-01 08:26:29 -07:00
# move proto files to the right places
cp -r github.com/cosmos/cosmos-sdk/* ./
rm -rf github.com
2020-07-01 08:26:29 -07:00