template / windows / files / Makefile
Branch windows · default branch · all branches
Makefile
| 1 | ifeq ($(OS),Windows_NT) |
| 2 | SHELL := pwsh.exe |
| 3 | else |
| 4 | SHELL := pwsh |
| 5 | endif |
| 6 | .SHELLFLAGS := -Command |
| 7 | |
| 8 | all: install |
| 9 | |
| 10 | clean: |
| 11 | go clean |
| 12 | |
| 13 | build: |
| 14 | go mod tidy |
| 15 | go build . |
| 16 | |
| 17 | lint: build |
| 18 | golangci-lint version |
| 19 | golangci-lint run |
| 20 | |
| 21 | .PHONY: test |
| 22 | test: build |
| 23 | New-Item -Path .\test\ -ItemType Directory -Force |
| 24 | go test -v -coverprofile="./test/coverage.out" |
| 25 | go tool cover -html="./test/coverage.out" -o "./test/coverage.html" |
| 26 | start "./test/coverage.html" |
| 27 | |
| 28 | install: build test lint |
| 29 | go install |
| 30 | template reset |
| 31 | |
| 32 | uninstall: |
| 33 | go clean -i gitlab.com/fuzzy-rp/template... |
| 34 | |
| 35 | release-dry-run: build test lint |
| 36 | go install github.com/goreleaser/goreleaser@latest |
| 37 | goreleaser release --snapshot --rm-dist |
| 38 | |
| 39 | release-local: build test lint |
| 40 | go install github.com/goreleaser/goreleaser@latest |
| 41 | goreleaser build --single-target |