makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. install:
  2. @echo "\033[94m• Setting up go test for wasm to run in the browser\033[00m"
  3. go install github.com/agnivade/wasmbrowsertest@latest
  4. mv `go env GOPATH`/bin/wasmbrowsertest `go env GOPATH`/bin/go_js_wasm_exec
  5. go install golang.org/x/tools/cmd/godoc@latest
  6. go install golang.org/x/perf/cmd/benchstat@latest
  7. .PHONY: test
  8. test:
  9. @echo "\033[94m• Running Go vet\033[00m"
  10. go vet ./...
  11. @echo "\033[94m\n• Running Go tests\033[00m"
  12. go test -race ./...
  13. @echo "\033[94m\n• Running go wasm tests\033[00m"
  14. GOARCH=wasm GOOS=js go test ./app
  15. release:
  16. ifdef VERSION
  17. @echo "\033[94m\n• Releasing ${VERSION}\033[00m"
  18. @git tag ${VERSION}
  19. @git push origin ${VERSION}
  20. else
  21. @echo "\033[94m\n• Releasing version\033[00m"
  22. @echo "\033[91mVERSION is not defided\033[00m"
  23. @echo "~> make VERSION=\033[90mv6.0.0\033[00m release"
  24. endif
  25. gen:
  26. @echo "\033[94m• Generating HTML Syntax\033[00m"
  27. @go generate ./app
  28. build:
  29. @echo "\033[94m• Building go-app documentation PWA\033[00m"
  30. @godoc -url /github.com/maxence-charriere/go-app/v9/app > ./docs/web/documents/reference.html
  31. @GOARCH=wasm GOOS=js go build -v -o docs/web/app.wasm ./docs/src
  32. @echo "\033[94m• Building go-app documentation\033[00m"
  33. @go build -o docs/documentation ./docs/src
  34. run: build
  35. @echo "\033[94m• Running go-app documentation server\033[00m"
  36. @cd docs && ./documentation local
  37. github: build
  38. @echo "\033[94m• Generating GitHub Pages\033[00m"
  39. @cd docs && ./documentation github
  40. clean:
  41. @go clean -v ./...
  42. -@rm docs/documentation
  43. @go mod tidy