forked from luceracloud/tachyon-aggregator
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfifo.mk
70 lines (53 loc) · 1.72 KB
/
fifo.mk
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
REBAR = $(shell pwd)/rebar3
PKG_VSN = $(shell head -n1 rel/pkg/Makefile | sed 's/[^0-9.p]//g')
REBAR_VSN = $(shell grep 'release' rebar.config | sed 's/[^0-9.p]//g')
VARS_VSN = $(shell grep 'bugsnag_app_version' rel/vars.config | sed -e 's/.*,//' -e 's/[^0-9.p]//g' -e 's/[.]$$//')
APP_VSN = $(shell grep vsn apps/$(APP)/src/$(APP).app.src | sed 's/[^0-9.p]//g')
compile: $(REBAR) .git/hooks/pre-commit
$(REBAR) compile
.git/hooks/pre-commit: hooks/pre-commit
cp hooks/pre-commit .git/hooks
pre-commit: test-scripts test-vsn lint xref dialyzer test
dialyzer: $(REBAR)
$(REBAR) dialyzer
xref: $(REBAR)
$(REBAR) xref
test-scripts:
for i in rel/files/*; do (head -1 $$i | grep -v sh > /dev/null) || bash -n $$i || exit 1; done;
test: $(REBAR)
$(REBAR) eunit
lint: $(REBAR)
$(REBAR) as lint lint
$(REBAR):
cp `which rebar3` $(REBAR)
upgrade: $(REBAR)
$(REBAR) upgrade
make tree
update: $(REBAR)
$(REBAR) update
tree: $(REBAR)
$(REBAR) tree | grep -v '=' | sed 's/ (.*//' > tree
tree-diff: tree
git diff test -- tree
###
### Docs
###
docs:
$(REBAR) edoc
###
### Version
###
vsn:
@echo "## rel/pkg/Makefile"
@echo "$(PKG_VSN)"
@echo "## apps/$(APP)/src/$(APP).app.src"
@echo "$(APP_VSN)"
@echo "## rebar.config"
@echo "$(REBAR_VSN)"
@echo "## rel/vars.config"
@echo "$(VARS_VSN)"
test-vsn:
@echo "Testing against package version: $(PKG_VSN)"
@[ "$(PKG_VSN)" == "$(APP_VSN)" ] && echo " - App version ok: $(APP_VSN)" || (echo "App version out of date" && false)
@[ "$(PKG_VSN)" == "$(REBAR_VSN)" ] && echo " - Rebar version ok: $(REBAR_VSN)" || (echo "Rebar version out of date" && false)
@[ "$(PKG_VSN)" == "$(VARS_VSN)" ] && echo " - Vars version ok: $(VARS_VSN)" || (echo "Vars version out of date" && false)