go.etcd.io/etcd@v3.3.27+incompatible/functional/scripts/genproto.sh (about) 1 #!/usr/bin/env bash 2 set -e 3 4 if ! [[ "$0" =~ "scripts/genproto.sh" ]]; then 5 echo "must be run from repository root" 6 exit 255 7 fi 8 9 # for now, be conservative about what version of protoc we expect 10 if ! [[ $(protoc --version) =~ "3.5.1" ]]; then 11 echo "could not find protoc 3.5.1, is it installed + in PATH?" 12 exit 255 13 fi 14 15 echo "Installing gogo/protobuf..." 16 GOGOPROTO_ROOT="$GOPATH/src/github.com/gogo/protobuf" 17 rm -rf $GOGOPROTO_ROOT 18 go get -v github.com/gogo/protobuf/{proto,protoc-gen-gogo,gogoproto,protoc-gen-gofast} 19 go get -v golang.org/x/tools/cmd/goimports 20 pushd "${GOGOPROTO_ROOT}" 21 git reset --hard HEAD 22 make install 23 popd 24 25 printf "Generating agent\n" 26 protoc --gofast_out=plugins=grpc:. \ 27 --proto_path=$GOPATH/src:$GOPATH/src/github.com/gogo/protobuf/protobuf:. \ 28 rpcpb/*.proto;