github.com/adoriasoft/tendermint@v0.34.0-dev1.0.20200722151356-96d84601a75a/scripts/protocgen.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -eo pipefail
     4  
     5  proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
     6  for dir in $proto_dirs; do
     7    protoc \
     8    -I "proto" \
     9    -I "third_party/proto" \
    10    --gogofaster_out=\
    11  Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
    12  Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,\
    13  plugins=grpc,paths=source_relative:. \
    14    $(find "${dir}" -maxdepth 1 -name '*.proto')
    15  
    16    if [[ $dir == *"abci"* ]]
    17    then
    18      protoc \
    19      -I "proto" \
    20      -I "third_party/proto" \
    21      --grpc-gateway_out=\
    22  Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
    23  Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,\
    24  paths=source_relative:. \
    25      $(find "${dir}" -maxdepth 1 -name '*.proto')
    26    fi
    27  done
    28  
    29  cp -r ./tendermint/* ./proto/*
    30  rm -rf tendermint
    31  
    32  mv ./proto/tendermint/abci/types.pb.go ./abci/types
    33  mv ./proto/tendermint/abci/types.pb.gw.go ./abci/types
    34  
    35  mv ./proto/tendermint/rpc/grpc/types.pb.go ./rpc/grpc