forked from segmentio/analytics.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (45 loc) · 1.52 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
PHANTOM = node_modules/.bin/mocha-phantomjs
PHANTOM_OPTS = --setting web-security=false --setting local-to-remote-url-access=true
# Compiles a one-file copy of analytics.js from all the development files.
analytics.js: install
component build --standalone analytics --out . --name analytics
# Adds a minified copy of analytics.js
min: analytics.js
uglifyjs -o analytics.min.js analytics.js
# Starts the testing server.
server:
node test/server.js &
# Kills the testing server.
kill:
kill -9 `cat test/pid.txt`
rm test/pid.txt
install:
component install
component:
component build --out . --name analytics.component --dev
# Runs all the tests on travis.
test: server
sleep 1
$(PHANTOM) $(PHANTOM_OPTS) http://localhost:8000/test/core.html
$(PHANTOM) $(PHANTOM_OPTS) http://localhost:8000/test/providers.html
$(PHANTOM) $(PHANTOM_OPTS) http://localhost:8000/test/min.html
make kill
# Runs only the non-minified core tests.
test-core: server
sleep 1
$(PHANTOM) $(PHANTOM_OPTS) http://localhost:8000/test/core.html
make kill
# Runs only the non-minified provider tests.
test-providers: server
sleep 1
$(PHANTOM) $(PHANTOM_OPTS) http://localhost:8000/test/providers.html
make kill
# Opens all the tests in your browser.
test-browser: server
sleep 1
open http://localhost:8000/test/core.html
open http://localhost:8000/test/providers.html
open http://localhost:8000/test/min.html
# Compiles, minfies, component, and tests analytics.js - wrapped up and good to go.
release: analytics.js min component test
.PHONY: analytics.js