2020-05-13 14:41:43 +02:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
2020-07-07 15:21:18 +02:00
|
|
|
GEN_PATH=src/app/proto/generated
|
2020-05-13 14:41:43 +02:00
|
|
|
|
|
|
|
echo "Create folders"
|
|
|
|
mkdir -p $GEN_PATH
|
|
|
|
|
|
|
|
echo "Generate grpc"
|
|
|
|
|
|
|
|
protoc \
|
2020-11-17 09:33:07 +01:00
|
|
|
-I=.tmp/protos/message \
|
|
|
|
-I=.tmp/protos/admin/proto \
|
|
|
|
-I=.tmp/protos/management/proto \
|
|
|
|
-I=.tmp/protos/auth/proto \
|
2020-07-07 15:21:18 +02:00
|
|
|
-I=node_modules/google-proto-files \
|
2020-11-17 09:33:07 +01:00
|
|
|
-I=.tmp/protos \
|
2020-05-13 14:41:43 +02:00
|
|
|
--js_out=import_style=commonjs,binary:$GEN_PATH \
|
|
|
|
--grpc-web_out=import_style=commonjs+dts,mode=grpcweb:$GEN_PATH \
|
2020-11-17 09:33:07 +01:00
|
|
|
.tmp/protos/message/proto/*.proto \
|
|
|
|
.tmp/protos/admin/proto/*.proto \
|
|
|
|
.tmp/protos/auth/proto/*.proto \
|
|
|
|
.tmp/protos/management/proto/*.proto
|
2020-05-13 14:41:43 +02:00
|
|
|
|
|
|
|
echo "Generate annotations js file (compatibility)"
|
|
|
|
|
|
|
|
mkdir -p $GEN_PATH/google/api/
|
|
|
|
touch $GEN_PATH/google/api/annotations_pb.js
|
|
|
|
echo "export {}" > $GEN_PATH/google/api/annotations_pb.d.ts
|
|
|
|
|
|
|
|
mkdir -p $GEN_PATH/validate
|
|
|
|
touch $GEN_PATH/validate/validate_pb.js
|
|
|
|
echo "export {}" > $GEN_PATH/validate/validate_pb.d.ts
|
|
|
|
|
|
|
|
mkdir -p $GEN_PATH/protoc-gen-swagger/options
|
|
|
|
touch $GEN_PATH/protoc-gen-swagger/options/annotations_pb.js
|
|
|
|
echo "export {}" > $GEN_PATH/protoc-gen-swagger/options/annotations_pb.d.ts
|
|
|
|
|
|
|
|
mkdir -p $GEN_PATH/authoption
|
|
|
|
touch $GEN_PATH/authoption/options_pb.js
|
2020-07-07 15:21:18 +02:00
|
|
|
echo "export {}" > $GEN_PATH/authoption/options_pb.d.ts
|