-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (46 loc) · 1.28 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
SOURCEDIR=inject/
SOURCES := $(shell find $(SOURCEDIR) -name '*.go' | \
grep -v vendor | \
grep -v test | \
grep -v mock)
PACKAGE=github.com/impinj/go-inject/inject
SAMPLE=github.com/impinj/go-inject/examples/basicauth
all: clean devtools vet fmt build test
.PHONY: deps
deps:
find . -name glide.yaml | while read gf; \
do \
pushd $$(dirname $$gf) > /dev/null; \
glide install; \
popd > /dev/null; \
done
.PHONY: build
build: deps $(SOURCES)
go build $(PACKAGE)
sample:
go build $(SAMPLE)
.PHONY: mocks
mocks: devtools $(SOURCES)
mockgen -destination=inject/mock/MockGraph.go $(PACKAGE) Graph
mockgen -destination=inject/mock/MockProvider.go $(PACKAGE) Provider
.PHONY: test
test: deps mocks
ginkgo -r $(SOURCE_DIR)
.PHONY: clean
clean:
go clean
find . -name vendor | while read vendor; \
do \
rm -rf $$vendor; \
done
.PHONY: fmt
fmt: $(SOURCES)
go fmt $(PACKAGE)
.PHONY: vet
vet: $(SOURCES)
go vet $(PACKAGE)
.PHONY: devtools
devtools:
go get -u github.com/Masterminds/glide
go get -u github.com/onsi/ginkgo/ginkgo
go get -u github.com/golang/mock/mockgen