forked from ChicagoBoss/ChicagoBoss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (64 loc) · 2.54 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
PREFIX:=../
DEST:=$(PREFIX)$(PROJECT)
ERL=erl
REBAR=./rebar
SESSION_CONFIG_DIR=priv/test_session_config
.PHONY: deps get-deps
all:
@$(REBAR) get-deps
@$(REBAR) compile
$(ERL) -pa ebin -pa deps/*/ebin \
-eval 'erlydtl:compile("src/boss/boss_html_error_template.dtl", boss_html_error_template, [{out_dir, "ebin"}])' \
-eval 'erlydtl:compile("src/boss/boss_html_doc_template.dtl", boss_html_doc_template, [{out_dir, "ebin"}])' \
-noshell -s init stop
boss:
@$(REBAR) compile skip_deps=true
$(ERL) -pa ebin -pa deps/*/ebin \
-eval 'erlydtl:compile("src/boss/boss_html_error_template.dtl", boss_html_error_template, [{out_dir, "ebin"}])' \
-eval 'erlydtl:compile("src/boss/boss_html_doc_template.dtl", boss_html_doc_template, [{out_dir, "ebin"}])' \
-noshell -s init stop
clean:
@$(REBAR) clean
edoc:
$(ERL) -pa ebin -pa deps/*/ebin -run boss_doc run -noshell -s init stop
#$(ERL) -pa ebin -noshell -eval "boss_doc:run()" -s init stop
app:
@$(REBAR) create template=skel dest=$(DEST) src=$(PWD) appid=$(PROJECT) skip_deps=true
get-deps:
@$(REBAR) get-deps
deps:
@$(REBAR) compile
test:
@$(REBAR) skip_deps=true eunit
test_session_cache:
$(ERL) -pa ebin -run boss_session_test start -config $(SESSION_CONFIG_DIR)/cache -noshell
test_session_mnesia:
$(ERL) -pa ebin -run boss_session_test start -config $(SESSION_CONFIG_DIR)/mnesia -noshell
test_session_mock:
$(ERL) -pa ebin -run boss_session_test start -config $(SESSION_CONFIG_DIR)/mock -noshell
rebarize:
@mv $(APPDIR)/*.app.src $(APPDIR)/src
@mkdir $(APPDIR)/priv/rebar
@cp skel/priv/rebar/boss_plugin.erl $(APPDIR)/priv/rebar/boss_plugin.erl
@cp skel/init.sh $(APPDIR)
@chmod +x $(APPDIR)/init.sh
@cp skel/init-dev.sh $(APPDIR)
@chmod +x $(APPDIR)/init-dev.sh
@cp skel/rebar $(APPDIR)
@chmod +x $(APPDIR)/rebar
@cp skel/rebar.config $(APPDIR)
@mkdir $(APPDIR)/src/test/functional
@find $(APPDIR)/src/test -maxdepth 1 -name "*.erl" -exec mv {} $(APPDIR)/src/test/functional \;
@mkdir $(APPDIR)/src/test/eunit
@echo $(APPDIR) rebar-boss-ified
@echo WARNING: your boss.config have not been changed, you need to set:
@echo - in boss app section:
@echo ---- {path, \"$(PWD)\"}
@echo ---- {vm_cookie, \"my_secret_cookie\"} % Optional, defaults to "abc123"
@echo - for each app defined:
@echo ---- {path, \"../path/to/app\"}
@echo INFO: you can safely remove the Makefile and start* files from your app dir
@echo INFO: after the boss.config change, you can run:
@echo cd $(APPDIR)
@echo ./rebar boss \# Shows all boss-rebar commands
@echo ./init.sh \# Shows the new boot system commands