-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (32 loc) · 902 Bytes
/
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
APP_VERSION=$(shell date '+%Y.%m.%d.%H%M%S')
VERSION=$(shell git describe --tags --always)
BUILD_TIME=$(shell date '+%Y.%m.%d.%H%M%S')
LDFLAGS="-X 'lovebox/cmd.version=${VERSION}' -X 'lovebox/cmd.date=${BUILD_TIME}'"
.PHONY: build
build:
go mod tidy
CGO_ENABLED=0 go build -o dist/lovebox main.go
.PHONY: build-ci
build-ci:
go build -ldflags ${LDFLAGS} -o bin/lovebox main.go
.PHONY: generate
generate:
go generate ./...
go-pkg-list:
export PKG_LIST="$(shell go list ./... | grep -v /vendor/)"
.PHONY: lint
lint:
@go lint $(shell go list ./... | grep -v /vendor/)
.PHONY: clean
clean:
@rm -f build/*
.PHONY: deps
deps:
@go mod tidy
.PHONY: coverage-report
coverage-report:
@go test -cover -v $(shell go list ./... | grep -v /vendor/) -coverprofile=build/coverage.out
@go tool cover -html=build/coverage.out
.PHONY: mocks
mocks:
go generate $(shell go list ./... | grep -v /vendor/)