Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (51 loc) · 2.01 KB
/
Copy pathMakefile
File metadata and controls
64 lines (51 loc) · 2.01 KB
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
63
64
#GOLANGCI_LINT_VERSION := "v1.43.0" # Optional configuration to pinpoint golangci-lint version.
# The head of Makefile determines location of dev-go to include standard targets.
GO ?= go
export GO111MODULE = on
ifneq "$(GOFLAGS)" ""
$(info GOFLAGS: ${GOFLAGS})
endif
ifneq "$(wildcard ./vendor )" ""
$(info Using vendor)
modVendor = -mod=vendor
ifeq (,$(findstring -mod,$(GOFLAGS)))
export GOFLAGS := ${GOFLAGS} ${modVendor}
endif
ifneq "$(wildcard ./vendor/github.com/bool64/dev)" ""
DEVGO_PATH := ./vendor/github.com/bool64/dev
endif
# adding github.com/dohernandez/dev-grpc
ifneq "$(wildcard ./vendor/github.com/dohernandez/dev-grpc)" ""
DEVGRPCGO_PATH := ./vendor/github.com/dohernandez/dev-grpc
endif
endif
ifeq ($(DEVGO_PATH),)
DEVGO_PATH := $(shell GO111MODULE=on $(GO) list ${modVendor} -f '{{.Dir}}' -m github.com/bool64/dev)
ifeq ($(DEVGO_PATH),)
$(info Module github.com/bool64/dev not found, downloading.)
DEVGO_PATH := $(shell export GO111MODULE=on && $(GO) get github.com/bool64/dev && $(GO) list -f '{{.Dir}}' -m github.com/bool64/dev)
endif
endif
# defining DEVGRPCGO_PATH
ifeq ($(DEVGRPCGO_PATH),)
DEVGRPCGO_PATH := $(shell GO111MODULE=on $(GO) list ${modVendor} -f '{{.Dir}}' -m github.com/bool64/dev)
ifeq ($(DEVGRPCGO_PATH),)
$(info Module github.com/dohernandez/dev-grpc not found, downloading.)
DEVGRPCGO_PATH := $(shell export GO111MODULE=on && $(GO) get github.com/dohernandez/dev-grpc && $(GO) list -f '{{.Dir}}' -m github.com/dohernandez/dev-grpc)
endif
endif
SRC_PROTO_PATH = ./testdata/proto
GO_PROTO_PATH = ./testdata
SWAGGER_PATH = ./testdata
-include $(DEVGRPCGO_PATH)/makefiles/protoc.mk
-include $(DEVGO_PATH)/makefiles/main.mk
-include $(DEVGO_PATH)/makefiles/lint.mk
-include $(DEVGO_PATH)/makefiles/test-unit.mk
# Add your custom targets here.
## Run tests
test: test-unit
## Check the commit compile and test the change.
check: fix-lint lint test
## Generate code from proto file(s)
proto-gen: proto-gen-code-swagger
.PHONY: test check proto-gen