-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild-protos-for-ts.sh
More file actions
48 lines (37 loc) · 1.39 KB
/
build-protos-for-ts.sh
File metadata and controls
48 lines (37 loc) · 1.39 KB
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
45
46
47
48
#!/bin/bash
BASEDIR=$(dirname "$0")
cd ${BASEDIR}/
DESIGNER_PROTO_DEST=./gen/proto/designer
AUTHOR_PROTO_DEST=./gen/proto/author
DESIGNER_PROTO_SRC=./proto/designer
AUTHOR_PROTO_SRC=./proto/author
mkdir -p ${DESIGNER_PROTO_DEST}
# JavaScript code generation
yarn run grpc_tools_node_protoc \
--js_out=import_style=commonjs,binary:${DESIGNER_PROTO_DEST} \
--grpc_out=${DESIGNER_PROTO_DEST} \
--plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin \
-I ${DESIGNER_PROTO_SRC} \
${DESIGNER_PROTO_SRC}/*.proto
# TypeScript code generation
yarn run grpc_tools_node_protoc \
--plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
--ts_out=${DESIGNER_PROTO_DEST} \
-I ${DESIGNER_PROTO_SRC} \
${DESIGNER_PROTO_SRC}/*.proto
DESIGNER_PROTO_DEST=./gen/proto/designer
DESIGNER_PROTO_SRC=./proto/designer
mkdir -p ${DESIGNER_PROTO_DEST}
# JavaScript code generation
yarn run grpc_tools_node_protoc \
--js_out=import_style=commonjs,binary:${AUTHOR_PROTO_DEST} \
--grpc_out=${AUTHOR_PROTO_DEST} \
--plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin \
-I ${AUTHOR_PROTO_SRC} \
${AUTHOR_PROTO_SRC}/*.proto
# TypeScript code generation
yarn run grpc_tools_node_protoc \
--plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
--ts_out=${AUTHOR_PROTO_DEST} \
-I ${AUTHOR_PROTO_SRC} \
${AUTHOR_PROTO_SRC}/*.proto