github.com/waldiirawan/apm-agent-go/v2@v2.2.2/Makefile (about)

     1  TEST_TIMEOUT?=5m
     2  GO_LICENSER_EXCLUDE=stacktrace/testdata
     3  GO_LANGUAGE_VERSION=1.15
     4  
     5  .PHONY: check
     6  check: precheck check-modules test
     7  
     8  .PHONY: precheck
     9  precheck: check-goimports check-vanity-import check-vet check-dockerfile-testing check-licenses model/marshal_fastjson.go scripts/Dockerfile-testing
    10  
    11  .PHONY: check-goimports
    12  check-goimports:
    13  	sh scripts/check_goimports.sh
    14  
    15  .PHONY: check-dockerfile-testing
    16  check-dockerfile-testing:
    17  	go run ./scripts/gendockerfile.go -d
    18  
    19  .PHONY: check-licenses
    20  check-licenses:
    21  	go run github.com/elastic/go-licenser -d $(patsubst %,-exclude %,$(GO_LICENSER_EXCLUDE)) .
    22  
    23  .PHONY: check-modules
    24  check-modules:
    25  	go run scripts/genmod/main.go -go=$(GO_LANGUAGE_VERSION) -check .
    26  
    27  .PHONY: check-vanity-import
    28  check-vanity-import:
    29  	sh scripts/check_vanity.sh
    30  
    31  .PHONY: check-vet
    32  check-vet:
    33  	@for dir in $(shell scripts/moduledirs.sh); do (cd $$dir && go vet ./...) || exit $$?; done
    34  
    35  .PHONY: docker-test
    36  docker-test:
    37  	scripts/docker-compose-testing run -T --rm go-agent-tests make test
    38  
    39  .PHONY: test
    40  test:
    41  	@for dir in $(shell scripts/moduledirs.sh); do (cd $$dir && go test -race -v -timeout=$(TEST_TIMEOUT) ./...) || exit $$?; done
    42  
    43  .PHONY: coverage
    44  coverage:
    45  	@bash scripts/test_coverage.sh
    46  
    47  .PHONY: fmt
    48  fmt:
    49  	@GOIMPORTSFLAGS=-w sh scripts/goimports.sh
    50  
    51  .PHONY: clean
    52  clean:
    53  	rm -fr docs/html
    54  
    55  .PHONY: update-modules
    56  update-modules:
    57  	go run scripts/genmod/main.go -go=$(GO_LANGUAGE_VERSION) .
    58  
    59  .PHONY: docs
    60  docs:
    61  ifdef ELASTIC_DOCS
    62  	$(ELASTIC_DOCS)/build_docs --direct_html --chunk=1 $(BUILD_DOCS_ARGS) --doc docs/index.asciidoc --out docs/html
    63  else
    64  	@echo "\nELASTIC_DOCS is not defined.\n"
    65  	@exit 1
    66  endif
    67  
    68  .PHONY: update-licenses
    69  update-licenses:
    70  	go-licenser $(patsubst %, -exclude %, $(GO_LICENSER_EXCLUDE)) .
    71  
    72  model/marshal_fastjson.go: model/model.go
    73  	go generate ./model
    74  
    75  scripts/Dockerfile-testing: $(wildcard module/*)
    76  	go generate ./scripts