Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. BUILD_DATE = $(shell date +%F_%T_%Z_%a)
  2. TAG=$(shell git describe --tags --abbrev=0)
  3. GO_VERS = $(shell go version | sed -e 's/ /_/g'| cut -b 12-)
  4. SERVICENAME=gostore
  5. build:
  6. clear
  7. go fmt ./...
  8. go build -ldflags "-w -s -X main.GoVersion=$(GO_VERS) -X main.Version=${TAG} -X main.Date=${BUILD_DATE}" -o ./bin/gostore ./cmd/gostore/main.go
  9. strip -s ./bin/gostore
  10. upx -f ./bin/gostore
  11. dev.run:
  12. clear
  13. rm -rf ./bin_dev
  14. mkdir -p ./bin_dev
  15. cp -rf ./web ./bin_dev
  16. go fmt ./...
  17. go build -race -o ./bin_dev/gostore_dev ./cmd/gostore/main.go
  18. ./dev.sh
  19. mod:
  20. clear
  21. go get -u ./...
  22. go mod tidy -compat=1.22.0
  23. go mod vendor
  24. go fmt ./...
  25. test.run:
  26. clear
  27. go fmt ./...
  28. go test -vet=all -race -timeout 30s -coverprofile cover.out ./...
  29. go tool cover -func=cover.out
  30. lint:
  31. clear
  32. go fmt ./...
  33. golangci-lint run ./cmd/serv_old/...
  34. golangci-lint run ./cmd/client_pwa/...
  35. golangci-lint run ./internal/...
  36. SERVICEURL=./
  37. graph:
  38. goda graph -f "{{.Package.Name}}" "shared($(SERVICEURL)... )" | dot -Tsvg -o ./doc/graph.svg
  39. dot:
  40. goda graph -f "{{.Package.Name}}" "shared($(SERVICEURL)... )" > ./doc/graph.dot
  41. dot1:
  42. image_packages ./ doc/packages.graphml