-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenerate.sh
executable file
·44 lines (34 loc) · 1014 Bytes
/
generate.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
40
41
42
43
44
mkdir -p ./generated
echo "Generating RoadRunner API"
for i in `find ./api -name "*.proto" -type f`; do
protoc \
--proto_path=api/third_party/api \
--proto_path=api/proto \
--php_out=generated $i \
--experimental_allow_proto3_optional
done
echo "Generating Temporal API"
GRPC_PLUGIN=`which grpc_php_plugin`
# If $GRPC_PLUGIN is empty then write error message and exit
if [ -z "$GRPC_PLUGIN" ]; then
echo "Error: grpc_php_plugin not found."
exit 1
fi
for i in `find ./api/third_party/api -name "*.proto" -type f`; do
protoc \
--proto_path=api/third_party/api \
--php_out=generated $i \
--plugin=protoc-gen-grpc=$GRPC_PLUGIN \
--grpc_out=generated \
--experimental_allow_proto3_optional
done
echo "Generating Gogo proto"
for i in `find ./proto -name "*.proto" -type f`; do
protoc \
--proto_path=proto \
--php_out=generated $i \
--experimental_allow_proto3_optional
done
echo "Removing Google Protobuf files"
rm -rf ./generated/Google
rm -rf ./generated/GPBMetadata/Google