-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
62 lines (45 loc) · 1.16 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
check-cago:
ifneq ($(which cago),)
go install github.com/codfrm/cago/cmd/cago@latest
endif
check-mockgen:
ifneq ($(which mockgen),)
go install go.uber.org/mock/mockgen@latest
endif
check-golangci-lint:
ifneq ($(which golangci-lint),)
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
endif
check-goconvey:
ifneq ($(which goconvey),)
go install github.com/smartystreets/goconvey@latest
endif
lint: check-golangci-lint
golangci-lint run
lint-fix: check-golangci-lint
golangci-lint run --fix
test: lint-fix
go test -v ./...
coverage.out cover:
go test -coverprofile=coverage.out -covermode=atomic ./...
go tool cover -func=coverage.out
html-cover: coverage.out
go tool cover -html=coverage.out
go tool cover -func=coverage.out
generate: check-mockgen check-cago
go generate ./...
cago genx
goconvey: check-goconvey
goconvey
GOOS=linux
GOARCH=amd64
APP_NAME=scriptlist
APP_VERSION=1.0.0
SUFFIX=
ifeq ($(GOOS),windows)
SUFFIX=.exe
endif
build:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o bin/$(APP_NAME)_v$(APP_VERSION)$(SUFFIX) ./cmd/app
cache_proxy:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o bin/cache_proxy$(SUFFIX) cmd/cache_proxy/main.go