-
Notifications
You must be signed in to change notification settings - Fork 195
/
Makefile
80 lines (61 loc) · 2 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
70
71
72
73
74
75
76
77
78
79
80
TEST_TIMEOUT?=5m
GO_LICENSER_EXCLUDE=stacktrace/testdata
GO_LANGUAGE_VERSION=1.21
.PHONY: check
check: precheck check-modules test
.PHONY: precheck
precheck: check-goimports check-vanity-import check-vet check-dockerfile-testing check-licenses model/marshal_fastjson.go scripts/Dockerfile-testing
.PHONY: check-goimports
check-goimports:
sh scripts/check_goimports.sh
.PHONY: check-dockerfile-testing
check-dockerfile-testing:
go run ./scripts/gendockerfile.go -d
.PHONY: check-licenses
check-licenses:
go run -modfile=tools/go.mod github.com/elastic/go-licenser -d $(patsubst %,-exclude %,$(GO_LICENSER_EXCLUDE)) .
.PHONY: check-modules
check-modules: update-modules
git diff --exit-code
.PHONY: check-vanity-import
check-vanity-import:
sh scripts/check_vanity.sh
.PHONY: check-vet
check-vet:
@for dir in $(shell scripts/moduledirs.sh); do (cd $$dir && go vet ./...) || exit $$?; done
.PHONY: docker-test
docker-test:
scripts/docker-compose-testing run -T --rm go-agent-tests make test
.PHONY: test
test:
@for dir in $(shell scripts/moduledirs.sh); do (cd $$dir && go test -race -v -timeout=$(TEST_TIMEOUT) ./...) || exit $$?; done
.PHONY: coverage
coverage:
@bash scripts/test_coverage.sh
.PHONY: fmt
fmt:
@GOIMPORTSFLAGS=-w sh scripts/goimports.sh
.PHONY: clean
clean:
rm -fr docs/html
.PHONY: update-modules
update-modules:
cd scripts/genmod && go run main.go -go=$(GO_LANGUAGE_VERSION) ../..
.PHONY: docs
docs:
ifdef ELASTIC_DOCS
$(ELASTIC_DOCS)/build_docs --direct_html --chunk=1 $(BUILD_DOCS_ARGS) --doc docs/index.asciidoc --out docs/html
else
@echo "\nELASTIC_DOCS is not defined.\n"
@exit 1
endif
.PHONY: update-licenses
update-licenses:
go run -modfile=tools/go.mod github.com/elastic/go-licenser $(patsubst %, -exclude %, $(GO_LICENSER_EXCLUDE)) .
model/marshal_fastjson.go: model/model.go
go generate ./model
module/apmgrpc/internal/testservice/testservice.pb.go:
./scripts/install-protobuf.sh
./scripts/generate-testservice.sh
scripts/Dockerfile-testing: $(wildcard module/*)
go generate ./scripts