forked from whiteblock/genesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (36 loc) · 986 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
47
48
49
50
51
52
53
GO111MODULE=on
PKG_SOURCES=$(wildcard pkg/*/*.go)
DIRECTORIES=$(wildcard util/*/) $(sort $(dir $(wildcard pkg/*/*/)))
MOCKS=$(foreach x, $(DIRECTORIES), mocks/$(x))
OUTPUT_DIR=./bin
.PHONY: build test test_race lint vet get mocks clean-mocks manual-mocks
.ONESHELL:
all: prep tester genesis
genesis: | get
go build
prep:
@mkdir $(OUTPUT_DIR) 2>> /dev/null | true
tester:
go build -o $(OUTPUT_DIR)/tester ./cmd/tester
test:
go test ./...
test_race:
go test ./... -race
lint:
golint $(go list ./... | grep -v mocks)
vet:
go vet $(go list ./... | grep -v mocks)
get:
go get ./...
clean-mocks:
rm -rf mocks
mocks: $(MOCKS) manual-mocks
$(MOCKS): mocks/% : %
mockery -output=$@ -dir=$^ -all
manual-mocks: clone-things mock-things
clone-things:
git clone https://github.com/whiteblock/definition.git mocks/.src/definition || true
mock-things:
cd mocks/.src/definition/command/ &&\
mockery -dir=. -output=../../../../mocks/definition/command/ -all && \
cd -