forked from getsentry/sentry-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (57 loc) · 1.74 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
RAVEN = ./src/raven.js
VERSION ?= $(shell cat version.txt)
RAVEN_FULL = ./build/raven.js
RAVEN_MIN = ./build/raven.min.js
BRANCH = $(shell git rev-parse --short --abbrev-ref HEAD)
TMP = /tmp/raven.min.js
TEST = test/index.html
REPORTER = dot
# Third party dependencies
DEPENDENCIES = \
./vendor/TraceKit/tracekit.js
develop: update-submodules
npm install .
update-submodules:
git submodule init
git submodule update
docs:
cd docs; $(MAKE) html
docs-live:
while true; do \
sleep 2; \
$(MAKE) docs; \
done
#
# Build the compressed all-in-one file
#
raven: clean
mkdir -p build
# Generate the full and compressed distributions
cat ./template/_copyright.js ${DEPENDENCIES} ./template/_header.js ${RAVEN} ./template/_footer.js | \
sed "s/@VERSION/${VERSION}/" >> ${RAVEN_FULL}
cd build && ../node_modules/.bin/uglifyjs --source-map=raven.min.map --comments=/^!/ -m -c -o raven.min.js raven.js
test:
@./node_modules/.bin/jshint .
@./node_modules/.bin/mocha-phantomjs -R ${REPORTER} ${TEST}
test-in-the-cloud:
@if [ ! -f Sauce-Connect.jar ]; then \
echo "Downloading Sauce Connect..."; \
curl https://saucelabs.com/downloads/Sauce-Connect-latest.zip > Sauce-Connect-latest.zip; \
unzip Sauce-Connect-latest Sauce-Connect.jar; \
rm Sauce-Connect-latest.zip; \
fi
@echo "Booting up Sauce Connect. This will take a while..."
@$(MAKE) runserver 2>&1 > /dev/null &
@java -jar Sauce-Connect.jar raven-js b39f5c10-ec75-40ce-8ca3-56727f2901f3 2>&1 > /dev/null &
@sleep 45
@clear
@node runtests.js
PORT = 8888
runserver:
python -m SimpleHTTPServer ${PORT}
clean:
rm -rf build
rm -rf docs/html
install-hooks:
cp -rfp hooks/* .git/hooks
.PHONY: develop update-submodules docs docs-live raven test test-in-the-cloud clean runserver install-hooks