-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
79 lines (62 loc) · 1.88 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
BUILD=build
.PHONY: release
release:
@echo "Release v$(version)"
@git pull
@git checkout master
@git pull
@git checkout develop
@git flow release start $(version)
@git flow release finish $(version) -p -m "Release v$(version)"
@git checkout develop
@echo "Release v$(version) finished."
.PHONY: all
all: coverage.out
coverage.out: $(shell find . -type f -print | grep -v vendor | grep "\.go")
@go test -race -cover -covermode=atomic -coverprofile ./coverage.out.tmp ./...
@cat ./coverage.out.tmp | grep -v '.pb.go' | grep -v 'mock_' > ./coverage.out
@rm ./coverage.out.tmp
.PHONY: test
test: coverage.out
.PHONY: cover
cover: coverage.out
@echo ""
@go tool cover -func ./coverage.out
.PHONY: cover-html
cover-html: coverage.out
@go tool cover -html=./coverage.out
.PHONY: benchmark
benchmark:
@go test -bench=. ./...
.PHONY: clean
clean:
@rm ./coverage.out
@go clean -i ./...
.PHONY: generate
generate:
@go generate ./...
.PHONY: lint
lint:
@golangci-lint run ./...
.PHONY: docs
docs:
@mkdir -p /tmp/tmpgoroot/doc
@rm -rf /tmp/tmpgopath/src/github.com/euskadi31/go-eventemitter
@mkdir -p /tmp/tmpgopath/src/github.com/euskadi31/go-eventemitter
@tar -c --exclude='.git' --exclude='tmp' . | tar -x -C /tmp/tmpgopath/src/github.com/euskadi31/go-eventemitter
@echo -e "open http://localhost:6060/pkg/github.com/euskadi31/go-eventemitter\n"
@GOROOT=/tmp/tmpgoroot/ GOPATH=/tmp/tmpgopath/ godoc -http=localhost:6060
pkg/license/template/bindata.go: $(shell find licenses -type f -name *.tpl)
@echo "Bin data..."
@go-bindata -pkg template -o $@ licenses/
${BUILD}/license: $(shell find . -type f -print | grep -v vendor | grep "\.go") pkg/license/template/bindata.go
@echo "Building license..."
@go generate ./cmd/license/
@go build -o $@ ./cmd/license/
.PHONY: build
build: ${BUILD}/license
run-license: ${BUILD}/license
@echo "Running license..."
@./$<
.PHONY: run
run: run-license