-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
46 lines (35 loc) · 997 Bytes
/
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
40
41
42
43
44
45
46
COMMIT=`git rev-parse HEAD`
all: deps check build
.PHONY: build
build: generate cli
.PHONY: generate
generate:
# can't seem to get this working with go:generate
go run github.com/OneOfOne/struct2ts/cmd/struct2ts --mark-optional-fields --indent=" " --out="./web/src/generated.ts" web.Config bench.Run
go generate ./...
.PHONY: cli
cli:
@echo Version $(COMMIT)
go build -ldflags "-X main.Version=$(COMMIT)"
.PHONY: deps
deps:
go mod download
go install
( cd web ; npm install )
.PHONY: check
check: check-go check-web
check-go:
go vet ./...
go fmt ./...
go run golang.org/x/lint/golint $(go list ./... | grep -v /vendor/)
go build -v
check-web:
(cd web ; npm run lint)
.PHONY: demo
demo: all
.PHONY: benches
benches: bench bench2 bench3 bench4 bench5 bench6
.PHONY: bench
bench bench2 bench3 bench4 bench5 bench6:
go test -cpu 1,2 -benchtime 10000x -bench . -benchmem ./... | ./gobenchdata --json benchmarks.json --append
cp ./benchmarks.json ./web/public/benchmarks.json