forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
102 lines (70 loc) · 2.5 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
91
92
93
94
95
96
97
98
99
100
101
102
PACKAGES=$(shell go list ./... | grep -v '/vendor/' | grep -v '_attic')
BUILD_FLAGS = -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=`git rev-parse --short HEAD`"
all: check_tools get_vendor_deps build test
########################################
### CI
ci: get_tools get_vendor_deps build test_cover
########################################
### Build
build:
@rm -rf examples/basecoin/vendor/
go build $(BUILD_FLAGS) -o build/basecoin ./examples/basecoin/cmd/...
dist:
@bash publish/dist.sh
@bash publish/publish.sh
########################################
### Tools & dependencies
check_tools:
cd tools && $(MAKE) check
get_tools:
cd tools && $(MAKE)
get_vendor_deps:
@rm -rf vendor/
@echo "--> Running glide install"
@glide install
draw_deps:
@# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
@goviz -i github.com/tendermint/tendermint/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
########################################
### Documentation
godocs:
@echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/cosmos/cosmos-sdk/types"
godoc -http=:6060
########################################
### Testing
TUTORIALS=$(shell find docs/guide -name "*md" -type f)
#test: test_unit test_cli test_tutorial
test: test_unit # test_cli
test_unit:
@rm -rf examples/basecoin/vendor/
@go test $(PACKAGES)
test_cover:
@bash test_cover.sh
test_tutorial:
@shelldown ${TUTORIALS}
@for script in docs/guide/*.sh ; do \
bash $$script ; \
done
benchmark:
@go test -bench=. $(PACKAGES)
########################################
### Devdoc
DEVDOC_SAVE = docker commit `docker ps -a -n 1 -q` devdoc:local
devdoc_init:
docker run -it -v "$(CURDIR):/go/src/github.com/cosmos/cosmos-sdk" -w "/go/src/github.com/cosmos/cosmos-sdk" tendermint/devdoc echo
# TODO make this safer
$(call DEVDOC_SAVE)
devdoc:
docker run -it -v "$(CURDIR):/go/src/github.com/cosmos/cosmos-sdk" -w "/go/src/github.com/cosmos/cosmos-sdk" devdoc:local bash
devdoc_save:
# TODO make this safer
$(call DEVDOC_SAVE)
devdoc_clean:
docker rmi -f $$(docker images -f "dangling=true" -q)
devdoc_update:
docker pull tendermint/devdoc
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: build dist check_tools get_tools get_vendor_deps draw_deps test test_unit test_tutorial benchmark devdoc_init devdoc devdoc_save devdoc_update