-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_pb.sh
executable file
·32 lines (27 loc) · 1.56 KB
/
build_pb.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
#!/bin/bash
#
# build the protobuf classes from the .proto. Note tested with
# protobuf 2.4.1. Current version is 2.5.0.
#
# Building:
#
# Running this script is only needed when the protobuf structures
# have change.
#
project_base="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# which protoc that you built (if not in your path)
PROTOC_HOME=/usr/local/Cellar/protobuf260/2.6.0
if [ -d ${project_base}/generated ]; then
echo "removing contents of ${project_base}/generated"
rm -r ${project_base}/generated/*
else
echo "creating directory ${project_base}/generated"
mkdir ${project_base}/generated
fi
$PROTOC_HOME/bin/protoc --proto_path=${project_base}/resources --java_out=${project_base}/generated ${project_base}/resources/common.proto
$PROTOC_HOME/bin/protoc --proto_path=${project_base}/resources --java_out=${project_base}/generated ${project_base}/resources/election.proto
$PROTOC_HOME/bin/protoc --proto_path=${project_base}/resources --java_out=${project_base}/generated ${project_base}/resources/work.proto
$PROTOC_HOME/bin/protoc --proto_path=${project_base}/resources --java_out=${project_base}/generated ${project_base}/resources/storage.proto
$PROTOC_HOME/bin/protoc --proto_path=${project_base}/resources --java_out=${project_base}/generated ${project_base}/resources/global.proto
$PROTOC_HOME/bin/protoc --proto_path=${project_base}/resources --java_out=${project_base}/generated ${project_base}/resources/pipe.proto
$PROTOC_HOME/bin/protoc --proto_path=${project_base}/resources --java_out=${project_base}/generated ${project_base}/resources/monitor.proto