-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
39 lines (34 loc) · 1.12 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
PLATFORM=$(shell uname -s | tr '[:upper:]' '[:lower:]')
VERSION := $(shell grep -Eo '(v[0-9]+[\.][0-9]+[\.][0-9]+(-[a-zA-Z0-9]*)?)' version.go)
USERID := $(shell id -u $$USER)
GROUPID:= $(shell id -g $$USER)
.PHONY: check
check:
ifeq ($(OS),Windows_NT)
@echo "Skipping checks on Windows, currently unsupported."
else
@wget -O lint-project.sh https://raw.githubusercontent.com/moov-io/infra/master/go/lint-project.sh
@chmod +x ./lint-project.sh
COVER_THRESHOLD=80.0 ./lint-project.sh
@rm -rf cmd/x12/output
endif
dist: clean
ifeq ($(OS),Windows_NT)
CGO_ENABLED=1 GOOS=windows go build -o bin/x12.exe github.com/moov-io/x12/cmd/x12
else
CGO_ENABLED=1 GOOS=$(PLATFORM) go build -o bin/x12-$(PLATFORM)-amd64 github.com/moov-io/x12/cmd/x12
endif
.PHONY: clean
clean:
ifeq ($(OS),Windows_NT)
@echo "Skipping cleanup on Windows, currently unsupported."
else
@rm -rf cover.out coverage.txt misspell* staticcheck*
@rm -rf ./bin/ openapi-generator-cli-*.jar x12.db ./storage/ lint-project.sh
@rm -rf cmd/x12/output
endif
.PHONY: cover-test cover-web
cover-test:
go test -coverprofile=cover.out ./...
cover-web:
go tool cover -html=cover.out