mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
scripts: consolidate and standardize protobuf generation
This commit is contained in:
parent
ec1df42d04
commit
c8c55aa378
@ -1,8 +0,0 @@
|
||||
set -e
|
||||
protoc --gogo_out=. -I=.:$GOPATH/src/code.google.com/p/gogoprotobuf/protobuf:$GOPATH/src *.proto
|
||||
|
||||
prefix=github.com/coreos/etcd/third_party
|
||||
sed \
|
||||
-i'.bak' \
|
||||
"s|code.google.com/p/gogoprotobuf/proto|$prefix/code.google.com/p/gogoprotobuf/proto|" *.go
|
||||
rm *.bak
|
@ -1,8 +0,0 @@
|
||||
set -e
|
||||
protoc --gogo_out=. -I=.:$GOPATH/src/code.google.com/p/gogoprotobuf/protobuf:$GOPATH/src *.proto
|
||||
|
||||
prefix=github.com/coreos/etcd/third_party
|
||||
sed \
|
||||
-i'.bak' \
|
||||
"s|code.google.com/p/gogoprotobuf/proto|$prefix/code.google.com/p/gogoprotobuf/proto|" *.go
|
||||
rm *.bak
|
35
scripts/genproto.sh
Executable file
35
scripts/genproto.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh -e
|
||||
#
|
||||
# Generate all etcd protobuf bindings.
|
||||
# Run from repository root.
|
||||
#
|
||||
|
||||
PREFIX="github.com/coreos/etcd/third_party"
|
||||
DIRS="./wal/walpb ./etcdserver/etcdserverpb ./snap/snappb ./raft/raftpb"
|
||||
|
||||
SHA="20c42d4d4d776b60d32c2d35ecac40a60793f661"
|
||||
|
||||
if ! protoc --version > /dev/null; then
|
||||
echo "could not find protoc, is it installed + in PATH?"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# Ensure we have the right version of protoc-gen-gogo by building it every time.
|
||||
# TODO(jonboulle): vendor this instead of `go get`ting it.
|
||||
export GOPATH=${PWD}/gopath
|
||||
export GOBIN=${PWD}/bin
|
||||
go get code.google.com/p/gogoprotobuf/{proto,protoc-gen-gogo,gogoproto}
|
||||
pushd ${GOPATH}/src/code.google.com/p/gogoprotobuf
|
||||
git reset --hard ${SHA}
|
||||
make
|
||||
popd
|
||||
|
||||
export PATH="${GOBIN}:${PATH}"
|
||||
|
||||
for dir in ${DIRS}; do
|
||||
pushd ${dir}
|
||||
protoc --gogo_out=. -I=.:${GOPATH}/src/code.google.com/p/gogoprotobuf/protobuf:${GOPATH}/src *.proto
|
||||
sed -i".bak" -e "s|code.google.com/p/gogoprotobuf/proto|${PREFIX}/code.google.com/p/gogoprotobuf/proto|" *.go
|
||||
rm -f *.bak
|
||||
popd
|
||||
done
|
@ -1,8 +0,0 @@
|
||||
set -e
|
||||
protoc --gogo_out=. -I=.:$GOPATH/src/code.google.com/p/gogoprotobuf/protobuf:$GOPATH/src *.proto
|
||||
|
||||
prefix=github.com/coreos/etcd/third_party
|
||||
sed \
|
||||
-i'.bak' \
|
||||
"s|code.google.com/p/gogoprotobuf/proto|$prefix/code.google.com/p/gogoprotobuf/proto|" *.go
|
||||
rm *.bak
|
@ -1,8 +0,0 @@
|
||||
set -e
|
||||
protoc --gogo_out=. -I=.:$GOPATH/src/code.google.com/p/gogoprotobuf/protobuf:$GOPATH/src *.proto
|
||||
|
||||
prefix=github.com/coreos/etcd/third_party
|
||||
sed \
|
||||
-i'.bak' \
|
||||
"s|code.google.com/p/gogoprotobuf/proto|$prefix/code.google.com/p/gogoprotobuf/proto|" *.go
|
||||
rm *.bak
|
Loading…
x
Reference in New Issue
Block a user