-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMakefile
60 lines (45 loc) · 1.71 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
export NPM_BIN:=$(CURDIR)/node_modules/.bin
# it should be export PATH:=$(CURDIR)/node_modules/.bin:$(PATH)
# but there is bug in OSX https://discussions.apple.com/thread/2520853
PACKAGE_VERSION = `node -p -e "require('./package.json').version"`
# сборка для npm
dist: build/*.js src/*.js | node_modules
echo '// DO NOT CHANGE MANUALLY (use Makefile)' > src/ns.version.js
printf "ns.VERSION = '%s';\n" $(PACKAGE_VERSION) >> src/ns.version.js
echo '// DO NOT CHANGE MANUALLY' >> src/ns.version.js
mkdir -p dist
$(NPM_BIN)/borschik -i build/src.client.js -o dist/noscript.js -m no
$(NPM_BIN)/borschik -i build/src.client.js -o dist/noscript.min.js -m yes
$(NPM_BIN)/borschik -i build/src.server.js -o dist/noscript.module.js -m no
touch dist
node_modules: package.json
npm install
touch node_modules
# Тесты
.PHONY: test test-jshint test-node test-karma yate test-browser
test:
$(MAKE) test-jshint
$(MAKE) test-karma test-node
test-jshint: dist | node_modules
$(NPM_BIN)/jshint src
$(NPM_BIN)/jscs src
test-node: dist yate | node_modules
$(NPM_BIN)/mocha test/node
test-karma: dist yate | node_modules
./node_modules/karma/bin/karma start
test-karma-live: dist yate | node_modules
./node_modules/karma/bin/karma start --single-run=false
test-browser: dist yate | node_modules
./node_modules/karma/bin/karma start --single-run=false --browsers
yate: test/tests.yate.js
test/tests.yate.js: test/tests.yate yate/noscript.yate | node_modules
$(NPM_BIN)/yate $< > $@
# публикация npm
npm-publish: dist
npm publish
gh-pages:
git clone -b gh-pages --reference ./ [email protected]:yandex-ui/noscript.git gh-pages
jsdoc: gh-pages
$(MAKE) -C gh-pages
jsdoc-publish: gh-pages
$(MAKE) -C gh-pages publish