-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgen_code.sh
executable file
·37 lines (33 loc) · 1.27 KB
/
gen_code.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
#!/bin/bash
# Golang
protoc --go_out=$GOPATH/src --go-grpc_out=$GOPATH/src supervisor/proto/supervisor.proto
protoc --go_out=$GOPATH/src --go-grpc_out=$GOPATH/src data/dailyprices/proto/daily_prices.proto
protoc --go_out=$GOPATH/src --go-grpc_out=$GOPATH/src algorithm/proto/algorithm_io.proto
# Python
python3 \
-m grpc_tools.protoc \
--proto_path=data/dailyprices/proto/ \
--python_out=data/dailyprices/proto/ \
--grpc_python_out=data/dailyprices/proto/ \
daily_prices.proto
sed \
-i '' 's/import daily_prices_pb2 as daily__prices__pb/from . import daily_prices_pb2 as daily__prices__pb/g' \
data/dailyprices/proto/daily_prices_pb2_grpc.py
python3 \
-m grpc_tools.protoc \
--proto_path=supervisor/proto/ \
--python_out=supervisor/proto/ \
--grpc_python_out=supervisor/proto/ \
supervisor.proto
sed \
-i '' 's/import supervisor_pb2 as supervisor__pb2/from . import supervisor_pb2 as supervisor__pb2/g' \
supervisor/proto/supervisor_pb2_grpc.py
python3 \
-m grpc_tools.protoc \
--proto_path=algorithm/proto \
--python_out=algorithm/proto/ \
--grpc_python_out=algorithm/proto/ \
algorithm_io.proto
sed \
-i '' 's/import algorithm_io_pb2 as algorithm__io__pb2/from . import algorithm_io_pb2 as algorithm__io__pb2/g' \
algorithm/proto/algorithm_io_pb2_grpc.py