54 lines
1.0 KiB
Makefile
54 lines
1.0 KiB
Makefile
# ALL_PKGS is the list of all packages where ALL_SRC files reside.
|
|
ALL_PKGS := $(sort $(shell go list ./...))
|
|
|
|
# Use a single process (-p 1) on go test to avoid tests clashing on machine
|
|
# wide resources, e.g. ports.
|
|
GOTEST_OPT?= -v -p 1 -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
|