forked from open-telemetry/opentelemetry-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.Common
51 lines (40 loc) · 920 Bytes
/
Makefile.Common
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
# ALL_PKGS is the list of all packages where ALL_SRC files reside.
ALL_PKGS := $(sort $(shell go list ./...))
GOTEST_OPT?= -race -timeout 120s
GOCMD?= go
GOTEST=$(GOCMD) test
GO_ACC=go-acc
LINT=golangci-lint
IMPI=impi
GOOS := $(shell $(GOCMD) env GOOS)
GOARCH := $(shell $(GOCMD) env GOARCH)
GH := $(shell which gh)
.PHONY: test
test:
$(GOTEST) $(GOTEST_OPT) ./...
.PHONY: test-with-cover
test-with-cover:
$(GO_ACC) --output=coverage.out ./...
.PHONY: benchmark
benchmark:
$(GOTEST) -bench=. -run=notests ./...
.PHONY: fmt
fmt:
gofmt -w -s ./
goimports -w -local go.opentelemetry.io/collector ./
.PHONY: tidy
tidy:
rm -fr go.sum
$(GOCMD) mod tidy -compat=1.18
.PHONY: lint
lint:
$(LINT) run
.PHONY: generate
generate:
$(GOCMD) generate ./...
.PHONY: impi
impi:
@$(IMPI) --local go.opentelemetry.io/collector --scheme stdThirdPartyLocal ./...
.PHONY: moddownload
moddownload:
$(GOCMD) mod download