-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (47 loc) · 1.37 KB
/
Makefile
File metadata and controls
60 lines (47 loc) · 1.37 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
GO_SRCS := $(shell find . -type f -name '*.go' -print)
GO_MODULE_FILES := go.mod go.sum
DEPS := $(GO_SRCS) $(GO_MODULE_FILES)
.PHONY: all
all: lint test
.PHONY: clean
clean: tools-clean
rm -rf dependencies
.PHONY: tidy
tidy:
go mod tidy
cd examples && go mod tidy
cd tools && go mod tidy
.PHONY: update
update:
go get -t -u all
go mod tidy
cd examples && go get -t -u all
cd examples && go mod tidy
cd tools && go list -f '{{if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' -m all | xargs echo go get --tags tools -t -u
cd tools && go mod tidy
dependencies: go.mod go.sum
go mod download
touch dependencies
examples/dependencies: examples/go.mod examples/go.sum
cd examples && go mod download
touch examples/dependencies
.PHONY: test
test: dependencies
go test -count 1 -timeout 5m ./...
cd examples && go test -count 1 -timeout 5m ./...
.PHONY: lint
lint: bin/golangci-lint
bin/golangci-lint config verify
bin/golangci-lint run
cd examples && ../bin/golangci-lint run --config ../.golangci.yaml
.PHONY: tools
tools: bin/golangci-lint
.PHONY: tools-clean
tools-clean:
rm -rf bin
rm -rf tools/dependencies
tools/dependencies: tools/go.mod tools/go.sum tools/tools.go
cd tools && go mod download
touch tools/dependencies
bin/golangci-lint: tools/dependencies
cd tools && go build -o ../bin/golangci-lint github.com/golangci/golangci-lint/v2/cmd/golangci-lint