forked from infobloxopen/protoc-gen-gorm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 1.07 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
GOPATH ?= $(HOME)/go
SRCPATH := $(patsubst %/,%,$(GOPATH))/src
default: vendor options install
.PHONY: vendor
vendor:
@dep ensure -vendor-only
.PHONY: vendor-update
vendor-update:
@dep ensure
.PHONY: options
options:
protoc -I. -I$(SRCPATH) -I./vendor \
--gogo_out="Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:$(SRCPATH)" \
options/gorm.proto
.PHONY: types
types:
protoc --go_out=$(SRCPATH) types/types.proto
install:
go install
example: default
protoc -I. -I$(SRCPATH) -I./vendor -I./vendor/github.com/grpc-ecosystem/grpc-gateway \
--go_out="plugins=grpc:$(SRCPATH)" --gorm_out="engine=postgres,enums=string:$(SRCPATH)" \
example/feature_demo/demo_multi_file.proto \
example/feature_demo/demo_types.proto \
example/feature_demo/demo_service.proto
protoc -I. -I$(SRCPATH) -I./vendor -I./vendor -I./vendor/github.com/grpc-ecosystem/grpc-gateway \
--go_out="plugins=grpc:$(SRCPATH)" --gorm_out="$(SRCPATH)" \
example/user/user.proto
test: example
go test -v ./...
go build ./example/user
go build ./example/feature_demo