forked from goadesign/gorma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (45 loc) · 1.37 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
#! /usr/bin/make
#
# Makefile for gorma
#
# Targets:
# - "lint" runs the linter and checks the code format using goimports
# - "test" runs the tests
#
# Meta targets:
# - "all" is the default target, it runs all the targets in the order above.
#
DIRS=$(shell go list -f {{.Dir}} ./... | grep -v /example)
DEPEND=\
bitbucket.org/pkg/inflect \
github.com/goadesign/goa.design/tools/mdc \
github.com/goadesign/goa.design/tools/godoc2md \
github.com/golang/lint/golint \
github.com/onsi/ginkgo \
github.com/spf13/hugo \
github.com/onsi/ginkgo/ginkgo \
github.com/onsi/gomega \
golang.org/x/tools/cmd/goimports \
.PHONY: goagen
all: depend lint test
docs:
@git clone https://github.com/goadesign/goa.design
@rm -rf goa.design/content/reference goa.design/public
@mdc github.com/goadesign/gorma goa.design/content/reference --exclude goa.design --exclude example
@cd goa.design && hugo
@rm -rf public
@mv goa.design/public public
@rm -rf goa.design
depend:
@go get $(DEPEND)
lint:
@for d in $(DIRS) ; do \
if [ "`goimports -l $$d/*.go | grep -vf .golint_exclude | tee /dev/stderr`" ]; then \
echo "^ - Repo contains improperly formatted go files" && echo && exit 1; \
fi \
done
@if [ "`golint ./... | grep -vf .golint_exclude | tee /dev/stderr`" ]; then \
echo "^ - Lint errors!" && echo && exit 1; \
fi
test:
@ginkgo -r --failOnPending --race -skipPackage vendor