-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
41 lines (36 loc) · 1.14 KB
/
makefile
File metadata and controls
41 lines (36 loc) · 1.14 KB
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
40
41
ifndef VERSION
ifndef RELEASE
# If we're not publishing a release, set the dev commit hash
ifndef DEV_TAG_SHA
COMMIT_HASH :=$(shell git rev-parse --short=7 HEAD)
else
COMMIT_HASH :=$(shell echo ${DEV_TAG_SHA} | cut -c 1-7)
endif
VERSION := dev-${COMMIT_HASH}
else
VERSION := $(shell git describe --tags --abbrev=0)
endif
endif
.PHONY: build
build:
go build -o ./bin/csvq -ldflags "-X github.com/adamdecaf/csvq.Version=${VERSION}" github.com/adamdecaf/csvq/cmd/csvq
.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=0.0 ./lint-project.sh
endif
build-webui:
cp $(shell go env GOROOT)/misc/wasm/wasm_exec.js ./docs/wasm_exec.js
GOOS=js GOARCH=wasm go build -o ./docs/csvq.wasm github.com/adamdecaf/csvq/internal/webui/
.PHONY: clean
clean:
@rm -rf ./bin/ ./tmp/ coverage.txt misspell* staticcheck lint-project.sh
.PHONY: cover-test cover-web
cover-test:
go test -coverprofile=cover.out ./...
cover-web:
go tool cover -html=cover.out