-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
69 lines (58 loc) · 1.62 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
63
64
65
66
67
68
69
export GO111MODULE=on
PKG = github.com/yuuki/lstf
COMMIT = $$(git describe --tags --always)
DATE = $$(date --utc '+%Y-%m-%d_%H:%M:%S')
BUILD_LDFLAGS = -X $(PKG).commit=$(COMMIT) -X $(PKG).date=$(DATE)
RELEASE_BUILD_LDFLAGS = -s -w $(BUILD_LDFLAGS)
.PHONY: build
build:
go build -ldflags="$(BUILD_LDFLAGS)"
.PHONY: test
test:
go test -v ./...
.PHONY: cover
cover: devel-deps
goveralls -service=travis-ci
.PHONY: devel-deps
devel-deps:
GO111MODULE=off go get -v \
golang.org/x/tools/cmd/cover \
github.com/mattn/goveralls \
github.com/motemen/gobump/cmd/gobump \
github.com/Songmu/ghch/cmd/ghch \
github.com/Songmu/goxz/cmd/goxz \
github.com/tcnksm/ghr \
github.com/Songmu/gocredits/cmd/gocredits
.PHONY: credits
credits:
GO111MODULE=off go get github.com/go-bindata/go-bindata/...
gocredits -w .
go generate -x .
.PHONY: crossbuild
crossbuild: devel-deps credits
$(eval ver = $(shell gobump show -r))
goxz -pv=v$(ver) -os=linux -arch=386,amd64 -build-ldflags="$(RELEASE_BUILD_LDFLAGS)" \
-d=./dist/v$(ver)
.PHONY: release
release: devel-deps
_tools/release
_tools/upload_artifacts
.PHONY: lint
lint:
go vet ./...
golint -set_exit_status ./...
.PHONY: check-deps
check-deps:
GO111MODULE=off go get -v \
honnef.co/go/tools/cmd/staticcheck \
github.com/kisielk/errcheck \
gitlab.com/opennota/check/cmd/aligncheck \
gitlab.com/opennota/check/cmd/structcheck \
gitlab.com/opennota/check/cmd/varcheck
.PHONY: check
check:
errcheck -asserts -blank -ignoretests -ignoregenerated -ignore 'Close,Fprint' ./... || true
staticcheck ./... || true
aligncheck ./... || true
structcheck ./... || true
varcheck ./... || true