-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
90 lines (72 loc) · 2.38 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
79
80
81
82
83
84
85
86
87
88
89
90
include Makefile.variable
announce:
$(call becho,"=== Ello Streams Project ===")
get-tools:
@go get -u "github.com/Masterminds/glide"
@go build "github.com/Masterminds/glide"
@go get -u "github.com/alecthomas/gometalinter"
# This is broken for the moment due to https://github.com/opennota/check/issues/25
# When that's fixed we can go back to the `gometalinter` command instead of individual installs
# @gometalinter --install --update --force
@go get -u -f "golang.org/x/tools/cmd/goimports"
@go get -u -f "github.com/kisielk/errcheck"
@go get -u -f "github.com/gordonklaus/ineffassign"
@go get -u -f "github.com/mibk/dupl"
@go get -u -f "github.com/alecthomas/gometalinter"
@go get -u -f "golang.org/x/tools/cmd/gotype"
@go get -u -f "github.com/tsenart/deadcode"
@go get -u -f "github.com/alecthomas/gocyclo"
@go get -u -f "github.com/mvdan/interfacer/cmd/interfacer"
@go get -u -f "github.com/golang/lint/golint"
@$(PRINT_OK)
install:export GO15VENDOREXPERIMENT=1
install: test
@echo "=== go install ==="
@go install -ldflags=$(GOLDFLAGS)
@$(PRINT_OK)
# From streams
all: test build docker
setup: announce get-tools dependencies
#TODO Try getting rid of the vendor flag env var after 1.6 is out
dependencies:export GO15VENDOREXPERIMENT=1
dependencies:
@glide install
@glide rebuild
@$(PRINT_OK)
clean:
@rm -rf vendor
@rm -rf bin
@$(PRINT_OK)
vet:export GO15VENDOREXPERIMENT=1
vet:
@go vet `glide novendor`
@$(PRINT_OK)
# TODO Re-enable these linters once vendor support is better (potentially 1.6)
lint:export GO15VENDOREXPERIMENT=1
lint:
@gometalinter --vendor --deadline=10s --disable=gotype --disable=varcheck --disable=aligncheck --disable=structcheck --disable=errcheck --disable=interfacer --dupl-threshold=70 `glide novendor`
@$(PRINT_OK)
fmt:export GO15VENDOREXPERIMENT=1
fmt:
@gofmt -s -w `glide nv | sed 's/\.\.\./*.go/g' | sed 's/.\///'`
@$(PRINT_OK)
build:export GO15VENDOREXPERIMENT=1
build:
@mkdir -p bin/
@go build -ldflags $(GOLDFLAGS) -o bin/streams
@$(PRINT_OK)
rebuild: clean build
docker: test
@docker build -t streams . > /dev/null 2>&1
@$(PRINT_OK)
test:export GO15VENDOREXPERIMENT=1
test:export LOGXI=dat:sqlx=off
test: fmt vet lint
@go test `glide novendor` -cover
@$(PRINT_OK)
server:export GO15VENDOREXPERIMENT=1
server:
@go run main.go
server-w:
@gin -a 8080 -i run
.PHONY: setup cloc errcheck vet lint fmt install build test deploy docker