mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
functional-tester/scripts/genproto: initial commit
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
8767e39bec
commit
3a8a150b0f
28
tools/functional-tester/scripts/genproto.sh
Executable file
28
tools/functional-tester/scripts/genproto.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if ! [[ "$0" =~ "scripts/genproto.sh" ]]; then
|
||||
echo "must be run from repository root"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# for now, be conservative about what version of protoc we expect
|
||||
if ! [[ $(protoc --version) =~ "3.5.1" ]]; then
|
||||
echo "could not find protoc 3.5.1, 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;
|
Loading…
x
Reference in New Issue
Block a user