forked from stephenmathieson/node-obfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (44 loc) · 1.14 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
BINS = node_modules/.bin
SRC = index.js $(wildcard lib/*.js)
TESTS = $(wildcard test/*.js)
EXAMPLES = $(wildcard examples/*/*.js)
ACCEPTANCE = $(wildcard test/acceptance/*.js)
MOCHA_REPORTER ?= spec
JSCOVERAGE ?= jscoverage
all: lint test test-acceptance
test: node_modules
@$(BINS)/mocha \
-R $(MOCHA_REPORTER) \
-r should
test-acceptance: examples/resolve/node_modules \
examples/express/node_modules \
$(ACCEPTANCE)
@echo 'everything looks good'
examples/resolve/node_modules: examples/resolve/package.json
@cd examples/resolve; npm install
examples/express/node_modules: examples/express/package.json
@cd examples/express; npm install
$(ACCEPTANCE):
node $@
test-cov: coverage.html
@open coverage.html
coverage.html: node_modules lib-cov $(TESTS)
@OBF_COV=1 \
MOCHA_REPORTER=html-cov \
$(MAKE) test > coverage.html
lib-cov: $(SRC)
@rm -rf $@
@$(JSCOVERAGE) lib $@
lint: node_modules
@$(BINS)/jshint \
--verbose \
$(SRC) \
$(TESTS) \
$(ACCEPTANCE)
node_modules: package.json
@npm install
clean:
rm -rf examples/*/obfuscated.js
rm -rf examples/*/node_modules
rm -rf lib-cov coverage.html
.PHONY: test $(ACCEPTANCE) clean