You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
820 B

7 years ago
  1. IMPORT := code.gitea.io/git
  2. PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
  3. GENERATE ?= code.gitea.io/git
  4. .PHONY: all
  5. all: clean test build
  6. .PHONY: clean
  7. clean:
  8. go clean -i ./...
  9. generate:
  10. @which mockery > /dev/null; if [ $$? -ne 0 ]; then \
  11. go get -u github.com/vektra/mockery/...; \
  12. fi
  13. go generate $(GENERATE)
  14. .PHONY: fmt
  15. fmt:
  16. find . -name "*.go" -type f -not -path "./vendor/*" | xargs gofmt -s -w
  17. .PHONY: vet
  18. vet:
  19. go vet $(PACKAGES)
  20. .PHONY: lint
  21. lint:
  22. @which golint > /dev/null; if [ $$? -ne 0 ]; then \
  23. go get -u github.com/golang/lint/golint; \
  24. fi
  25. for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
  26. .PHONY: test
  27. test:
  28. for PKG in $(PACKAGES); do go test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
  29. .PHONY: build
  30. build:
  31. go build .