-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
200 lines (146 loc) · 4.07 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
.PHONY: docs
POLVO=node_modules/polvo/bin/polvo
SELENIUM=test/services/selenium-server-standalone-2.35.0.jar
SAUCE_CONNECT=test/services/Sauce-Connect.jar
CHROME_DRIVER=test/services/chromedriver
CS=node_modules/coffee-script/bin/coffee
MOCHA=node_modules/mocha/bin/mocha
COVERALLS=node_modules/coveralls/bin/coveralls.js
MVERSION=node_modules/mversion/bin/version
VERSION=`$(MVERSION) | sed -E 's/\* package.json: //g'`
CODO=node_modules/codo/bin/codo
BOWER=node_modules/bower/bin/bower
setup: install_test_suite
npm install
@$(BOWER) install
watch:
@$(CS) -bwo lib src
build:
@$(CS) -bco lib src
build.test: build
@cp lib/index.js test/fixtures/the-model.js
# docs generation
docs:
cd src && \
../$(CODO) \
-o ../docs \
--cautious \
-t 'The-Model' \
index.coffee \
.
docs.server:
cd src && \
../$(YUIDOC) \
--syntaxtype coffee \
-e .coffee \
-o ../docs/src \
-t ../docs/yuidoc-bootstrap-theme.git \
-H ../docs/yuidoc-bootstrap-theme.git/helpers/helpers.js \
--server \
.
bump.minor:
@$(MVERSION) minor
bump.major:
@$(MVERSION) major
bump.patch:
@$(MVERSION) patch
publish:
git tag $(VERSION)
git push origin $(VERSION)
git push origin master
npm publish
re-publish:
git tag -d $(VERSION)
git tag $(VERSION)
git push origin :$(VERSION)
git push origin $(VERSION)
git push origin master -f
npm publish -f
# TEST
# ------------------------------------------------------------------------------
# setup
install_test_suite:
@mkdir -p test/services
@echo '-----'
@echo 'Downloading Selenium..'
@curl -o test/services/selenium-server-standalone-2.35.0.jar \
https://selenium.googlecode.com/files/selenium-server-standalone-2.35.0.jar
@echo 'Done.'
@echo '-----'
@echo 'Downloading Chrome Driver..'
@curl -o test/services/chromedriver.zip \
https://chromedriver.googlecode.com/files/chromedriver_mac32_2.3.zip
@echo 'Done.'
@echo '-----'
@echo 'Unzipping chromedriver..'
@cd test/services/; unzip chromedriver.zip; \
rm chromedriver.zip; cd -
@echo 'Done.'
@echo '-----'
@echo 'Downloading Sauce Connect..'
@curl -o test/services/sauceconnect.zip \
http://saucelabs.com/downloads/Sauce-Connect-latest.zip
@echo '-----'
@echo 'Unzipping Sauce Connect..'
@cd test/services/; unzip sauceconnect.zip; \
rm NOTICE.txt license.html sauceconnect.zip; cd -
@echo '-----'
@echo 'Done.'
@echo
# services
test.selenium.run:
@java -jar $(SELENIUM) -Dwebdriver.chrome.driver=$(CHROME_DRIVER)
test.sauce.connect.run:
@java -jar $(SAUCE_CONNECT) $(SAUCE_USERNAME) $(SAUCE_ACCESS_KEY)
# building
test.build.prod:
@echo 'Building app before testing..'
@$(POLVO) -rb test/fixtures/app > /dev/null
test.build.split:
@echo 'Compiling app before testing..'
@$(POLVO) -cxb test/fixtures/app > /dev/null
# coverage
test.cover.normalize:
@sed -i.bak \
"s/^.*public\/__split__\/lib/SF:lib/g" \
test/coverage/lcov.info
test.cover.publish:
@cd test/fixtures/app/public/__split__/ && \
cat ../../../../coverage/lcov.info | \
../../../../../$(COVERALLS)
@cd ../../../../..
test.api.run:
@cd test/fixtures/api; ../../../$(CS) index.coffee --autoinit
test.app.run:
@cd test/fixtures/app; ../../../$(POLVO) -ws
# local
test: test.build.prod
@$(MOCHA) --compilers coffee:coffee-script \
--ui bdd \
--reporter spec \
--timeout 600000 \
test/runner.coffee --env='local'
test.cover: test.build.split
@$(MOCHA) --compilers coffee:coffee-script \
--ui bdd \
--reporter spec \
--timeout 600000 \
test/runner.coffee --env='local' --coverage
# coveralls
test.coveralls: test.cover test.cover.normalize test.cover.publish
test.cover.preview: test.cover
@cd test/coverage/lcov-report; python -m SimpleHTTPServer 8080; cd -
# sauce labs
test.sauce: test.build.prod
@$(MOCHA) --compilers coffee:coffee-script \
--ui bdd \
--reporter spec \
--timeout 600000 \
test/runner.coffee --env='sauce labs'
test.sauce.cover: test.build.split
@$(MOCHA) --compilers coffee:coffee-script \
--ui bdd \
--reporter spec \
--timeout 600000 \
test/runner.coffee --env='sauce labs' --coverage
test.sauce.coveralls: test.sauce.cover test.cover.normalize test.cover.publish