forked from tronprotocol/grpc-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-proto.sh
executable file
·29 lines (22 loc) · 908 Bytes
/
gen-proto.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
# change work dir to project dir
# cd $GOPATH/src/github.com/tronprotocol/grpc-gateway/protocol
# Generate gRPC stub
protoc -I=./protocol \
-I$GOPATH/src/github.com/tronprotocol/grpc-gateway/third_party/googleapis \
--go_out=plugins=grpc:../../../ \
./protocol/core/*.proto
protoc -I=./protocol \
-I$GOPATH/src/github.com/tronprotocol/grpc-gateway/third_party/googleapis \
--go_out=plugins=grpc:../../../ \
./protocol/api/*.proto
# Generate reverse-proxy
protoc -I=./protocol \
-I$GOPATH/src/github.com/tronprotocol/grpc-gateway/third_party/googleapis \
--grpc-gateway_out=logtostderr=true:../../../ \
./protocol/api/*.proto
# (Optional) Generate swagger definitions
protoc -I./protocol \
-I$GOPATH/src \
-I$GOPATH/src/github.com/tronprotocol/grpc-gateway/third_party/googleapis \
--swagger_out=logtostderr=true:../../../ \
./protocol/api/*.proto