2020-01-24 07:32:00 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eo pipefail
|
|
|
|
|
2020-06-18 10:04:26 -07:00
|
|
|
proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
|
2020-01-24 07:32:00 -08:00
|
|
|
for dir in $proto_dirs; do
|
|
|
|
protoc \
|
2020-06-18 10:04:26 -07:00
|
|
|
-I "proto" \
|
|
|
|
-I "third_party/proto" \
|
|
|
|
--gocosmos_out=plugins=interfacetype+grpc,\
|
2020-05-05 07:28:20 -07:00
|
|
|
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')
|
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')
|
2020-01-24 07:32:00 -08:00
|
|
|
done
|
2020-06-18 10:04:26 -07:00
|
|
|
|
2020-07-01 08:26:29 -07:00
|
|
|
# generate codec/testdata proto code
|
2020-07-20 05:30:12 -07:00
|
|
|
protoc -I "proto" -I "third_party/proto" -I "testutil/testdata" --gocosmos_out=plugins=interfacetype+grpc,\
|
2020-07-20 09:51:16 -07:00
|
|
|
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
|
2020-06-18 10:04:26 -07:00
|
|
|
cp -r github.com/cosmos/cosmos-sdk/* ./
|
|
|
|
rm -rf github.com
|
2020-07-01 08:26:29 -07:00
|
|
|
|
|
|
|
|