mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

The main genproto.sh script requires latest version, this confirms the test protoc to do the same.
29 lines
813 B
Bash
Executable File
29 lines
813 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
if ! [[ "$0" =~ "scripts/genproto.sh" ]]; then
|
|
echo "must be run from repository root"
|
|
exit 255
|
|
fi
|
|
|
|
# protoc version should be the same as one in main etcd scripts.
|
|
if [[ $(protoc --version | cut -f2 -d' ') != "3.14.0" ]]; then
|
|
echo "could not find protoc 3.14.0, is it installed + in PATH?"
|
|
exit 255
|
|
fi
|
|
|
|
echo "Installing gogo/protobuf..."
|
|
GOGOPROTO_ROOT="$GOPATH/src/github.com/gogo/protobuf"
|
|
rm -rf $GOGOPROTO_ROOT
|
|
go get -v github.com/gogo/protobuf/{proto,protoc-gen-gogo,gogoproto,protoc-gen-gofast}
|
|
go get -v golang.org/x/tools/cmd/goimports
|
|
pushd "${GOGOPROTO_ROOT}"
|
|
git reset --hard HEAD
|
|
make install
|
|
popd
|
|
|
|
printf "Generating agent\n"
|
|
protoc --gofast_out=plugins=grpc:. \
|
|
--proto_path=$GOPATH/src:$GOPATH/src/github.com/gogo/protobuf/protobuf:. \
|
|
rpcpb/*.proto;
|