-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
23 lines (21 loc) · 1.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
SRC_DIR=api
DST_DIR=$(SRC_DIR)
GATEWAY_VERSION=v1.12.2-0.20191203171358-3c06998610d4
generateGrpc:
protoc -I=$(SRC_DIR) \
-I$(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@$(GATEWAY_VERSION)/third_party/googleapis \
-I=$(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@$(GATEWAY_VERSION) \
--go_out=plugins=grpc:$(DST_DIR) \
$(SRC_DIR)/*.proto
generateGateway:
protoc -I=$(SRC_DIR) \
-I$(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@$(GATEWAY_VERSION)/third_party/googleapis \
-I=$(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@$(GATEWAY_VERSION) \
--grpc-gateway_out=logtostderr=true:$(DST_DIR) \
$(SRC_DIR)/*.proto
generateSwagger:
protoc -I=$(SRC_DIR) \
-I=$(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@$(GATEWAY_VERSION)/third_party/googleapis \
-I=$(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@$(GATEWAY_VERSION) \
--swagger_out=logtostderr=true,allow_merge=true:$(DST_DIR) $(SRC_DIR)/*.proto
api: generateGrpc generateGateway generateSwagger