Makefile 642 B

1234567891011121314151617181920212223242526272829
  1. GOBASE=$(shell pwd)
  2. GOBIN=$(GOBASE)/bin
  3. help:
  4. @echo "This is a helper makefile for oapi-codegen"
  5. @echo "Targets:"
  6. @echo " generate: regenerate all generated files"
  7. @echo " test: run all tests"
  8. @echo " gin_example generate gin example server code"
  9. @echo " tidy tidy go mod"
  10. $(GOBIN)/golangci-lint:
  11. curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.50.1
  12. .PHONY: tools
  13. tools: $(GOBIN)/golangci-lint
  14. lint: tools
  15. $(GOBIN)/golangci-lint run ./...
  16. generate:
  17. go generate ./...
  18. test:
  19. go test -cover ./...
  20. tidy:
  21. @echo "tidy..."
  22. go mod tidy