forked from segmentio/analytics.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (39 loc) · 1.23 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
TEST = http://localhost:4200
COMPONENT = node_modules/component/bin/component
UGLIFY = node_modules/uglify-js/bin/uglifyjs
PHANTOM = node_modules/.bin/mocha-phantomjs --setting web-security=false --setting local-to-remote-url-access=true
# Default
default build: build/build.js
# Reals
analytics.js: node_modules components $(shell find lib)
@$(COMPONENT) build --standalone analytics --out . --name analytics
@$(UGLIFY) analytics.js --output analytics.min.js
build/build.js: node_modules components $(shell find lib)
@$(COMPONENT) build --dev
components: component.json
@$(COMPONENT) install --dev
node_modules: package.json
@npm install
# Phonies
clean:
@rm -rf components build node_modules
kill:
@kill -9 `cat test/server/.pid.txt`
@rm test/server/.pid.txt
server: node_modules
@node test/server/index.js &
release: test-release
test: node_modules build/build.js server
@sleep 1
-@$(PHANTOM) $(TEST)/core
-@$(PHANTOM) $(TEST)/integrations
@make kill
test-browser: node_modules build/build.js server
@sleep 1
@open $(TEST)/core
@open $(TEST)/integrations
test-release: node_modules analytics.js build/build.js server
@sleep 1
-@$(PHANTOM) $(TEST)/all
@make kill
.PHONY: clean kill install release server test test-browser