forked from motiv-labs/janus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (49 loc) · 1.75 KB
/
Makefile
File metadata and controls
65 lines (49 loc) · 1.75 KB
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
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
# The import path is the unique absolute name of your repository.
# All subpackages should always be imported as relative to it.
# If you change this, run `make clean`.
PKG_SRC := github.com/hellofresh/janus
.PHONY: all clean deps build
all: clean deps test build
deps:
@echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)"
@go get -u golang.org/x/lint/golint
@go get -u github.com/DATA-DOG/godog/cmd/godog
build:
@echo "$(OK_COLOR)==> Building... $(NO_COLOR)"
@/bin/sh -c "JANUS_BUILD_ONLY_DEFAULT=$(JANUS_BUILD_ONLY_DEFAULT) PKG_SRC=$(PKG_SRC) VERSION=$(VERSION) ./build/build.sh"
test: lint format vet
@echo "$(OK_COLOR)==> Running tests$(NO_COLOR)"
@go test -v -cover ./...
test-integration: lint format vet
@echo "$(OK_COLOR)==> Running tests$(NO_COLOR)"
@go test -v -cover -tags=integration ./...
test-features:
@/bin/sh -c "JANUS_BUILD_ONLY_DEFAULT=1 PKG_SRC=$(PKG_SRC) ./build/build.sh"
@/bin/sh -c "./build/features.sh"
format:
@echo "$(OK_COLOR)==> checking code formating with 'gofmt' tool$(NO_COLOR)"
@gofmt -l -s cmd pkg | grep ".*\.go"; if [ "$$?" = "0" ]; then exit 1; fi
vet:
@echo "$(OK_COLOR)==> checking code correctness with 'go vet' tool$(NO_COLOR)"
@go vet ./...
lint: tools.golint
@echo "$(OK_COLOR)==> checking code style with 'golint' tool$(NO_COLOR)"
@go list ./... | xargs -n 1 golint -set_exit_status
clean:
@echo "$(OK_COLOR)==> Cleaning project$(NO_COLOR)"
@go clean
@rm -rf bin $GOPATH/bin
#---------------
#-- tools
#---------------
.PHONY: tools tools.golint
tools: tools.golint
tools.golint:
@command -v golint >/dev/null ; if [ $$? -ne 0 ]; then \
echo "--> installing golint"; \
go get github.com/golang/lint/golint; \
fi