This repository has been archived by the owner on Feb 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (42 loc) · 1.55 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
LINTIGNOREDEPS='vendor/.+\.go'
source_ONLY_PKGS=$(shell go list ./... 2> /dev/null | grep -v "/,/" | grep -v "/private/" | grep -v "/vendor/")
source_WITH_VENDOR_PKGS=$(shell go list ./... 2> /dev/null | grep -v "/,/" | grep -v "/private/" | grep -v "/vendor/src")
all: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " docs to build source documentation"
@echo " build to go build the source"
@echo " unit to run unit tests"
@echo " verify to verify tests"
@echo " lint to lint the source"
@echo " vet to vet the source"
@echo " generate to go generate and make services"
docs:
@echo "generate source docs"
@cd ./docs/api && bundle install && bundle exec rake
build:
@echo "go build source and vendor packages"
unit: build verify test
test:
@echo "go test source and vendor packages"
@go test $(source_ONLY_PKGS)
generate: gen-core gen-app gen-views
generate-gae: gen-core gen-app-gae gen-views
gen-core:
go generate ./core/...
gen-views:
go generate ./client/...
gen-app:
go generate ./internal/app/...
gen-app-gae:
SOURCE_GAE=1 go generate ./internal/app/...
verify: vet
lint:
@echo "go lint packages"
@lint=`golint ./...`; \
lint=`echo "$$lint" | grep -E -v -e ${LINTIGNOREDEPS}`; \
echo "$$lint"; \
if [ "$$lint" != "" ]; then exit 1; fi
vet:
@echo "go vet packages"
@go tool vet -all -structtags -shadow $(shell ls -d */ | grep -v "," | grep -v "private" | grep -v "vendor")