-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (36 loc) · 892 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
42
43
VERSION=`git describe --tags`
DATE=`date +%Y.%m.%d.%H%M%S`
# build the cli
.PHONY: cli
cli:
rm -f tex-cli
go build -ldflags "-X main.Version=$(VERSION) -X main.CompileDate=$(DATE)" -o ./tex-cli ./cmd/tex
.PHONY: release-cli
release-cli:
bash .scripts/cli.sh
# cleanup dependencies and download missing ones
.PHONY: deps
deps:
go mod tidy
go mod download
# run dependency cleanup, followed by updating the patch version
.PHONY: deps-update
deps-update: deps
go get -u=patch
# run tests
.PHONY: tests
tests:
go test -race -cover -count 1 ./...
# run standard go tooling for better rcode hygiene
.PHONY: tidy
tidy: imports fmt
go vet ./...
golint ./...
# automatically add missing imports
.PHONY: imports
imports:
find . -type f -name '*.go' -exec goimports -w {} \;
# format code and simplify if possible
.PHONY: fmt
fmt:
find . -type f -name '*.go' -exec gofmt -s -w {} \;