-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (48 loc) · 1.47 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
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.PHONY: init
init:
go get -v -u golang.org/x/tools/cmd/goimports
## dep
.PHONY: redep
redep:
rm -rf ./vendor
make dep
.PHONY: dep
dep:
go get -v -u github.com/golang/dep/cmd/dep
dep ensure -v
## grpc
GRPC_GATEWAY_REPO=${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis
PROTO_NAME=hello
.PHONY: init_grpc
init_grpc:
go get -v -u github.com/golang/protobuf/protoc-gen-go
go get -v -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
.PHONY: protoc_go
protoc_go:
protoc -I. \
-I${GRPC_GATEWAY_REPO} \
--go_out=plugins=grpc:. \
pb/${PROTO_NAME}.proto
.PHONY: protoc_gateway_go
protoc_gateway_go:
protoc -I/usr/local/include -I. -I${GOPATH}/src \
-I${GRPC_GATEWAY_REPO} \
--grpc-gateway_out=logtostderr=true:. \
pb/${PROTO_NAME}.gw.proto
.PHONY: downgrade_protoc # https://qiita.com/go_sagawa/items/5ba0ebb0cf42a629e2e9
downgrade_protoc:
brew upgrade protobuf
go get -v -u google.golang.org/grpc
go get -v -u github.com/golang/protobuf/proto
go get -v -u github.com/golang/protobuf/protoc-gen-go
go get -v -u go.pedge.io/protoeasy/cmd/protoeasy
go get -v -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -v -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
cd ${GOPATH}/src/github.com/golang/protobuf/protoc-gen-go
git checkout v1.2.0
go install
git checkout master
cd ${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
git checkout v1.5.1
go install
git checkout master