-
Notifications
You must be signed in to change notification settings - Fork 10
/
test.sh
executable file
·39 lines (30 loc) · 884 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
REPO="github.com/kylelemons/go-rpcgen"
function err {
echo "$@"
exit 1
}
set -e
if ! which protoc >/dev/null; then
err "Could not find 'protoc'"
fi
echo "Building protoc-gen-go..."
go build -o protoc-gen-go/protoc-gen-go $REPO/protoc-gen-go
export PATH="protoc-gen-go/:$PATH"
echo "Building protobufs..."
for PROTO in $(find . -name "*.proto" | grep -v "example_ae" | grep -v "option.proto"); do
echo " - Compiling ${PROTO}..."
GO_STUBS="rpc,web" protoc --go_out=. ${PROTO}
done
echo "Building appengine protobufs..."
pushd example_ae >/dev/null
for PROTO in $(find . -name "*.proto"); do
echo " - Compiling ${PROTO} for appengine..."
../ae_protoc.sh ${PROTO}
done
popd >/dev/null
echo "Testing packages..."
PACKAGES=$(find . -name "*_test.go" -exec dirname {} \; | sort | uniq)
go test -i ${PACKAGES}
go test ${PACKAGES}
go install ./protoc-gen-go