burnchart/Makefile

62 lines
1.4 KiB
Makefile
Raw Normal View History

2014-10-29 04:30:42 +00:00
BROWSERIFY = ./node_modules/.bin/browserify
2014-11-01 01:34:50 +00:00
WATCHIFY = ./node_modules/.bin/watchify
LESS = ./node_modules/.bin/lessc
WATCH = ./node_modules/.bin/watch
2014-10-29 04:30:42 +00:00
SERVER = ./node_modules/.bin/static
MOCHA = ./node_modules/.bin/mocha
COVERALLS = ./node_modules/.bin/coveralls
GRUNT = grunt
2014-10-27 02:57:44 +00:00
# Install dependencies.
2014-08-29 02:55:45 +00:00
install:
npm install
2014-10-27 03:10:41 +00:00
watch:
2014-11-01 01:34:50 +00:00
${MAKE} watch-js & ${MAKE} watch-css
2014-10-29 04:30:42 +00:00
# Watch the app.
watch-js:
2014-11-01 01:34:50 +00:00
${WATCHIFY} -e ./src/app.coffee -o public/js/app.bundle.js -d -v
2014-10-29 04:30:42 +00:00
# Watch the styles.
watch-css:
2014-11-01 01:34:50 +00:00
${MAKE} build-css
${WATCH} "${MAKE} build-css" src/styles
2014-08-29 02:55:45 +00:00
2014-10-27 02:57:44 +00:00
# Serve locally.
2014-08-29 02:55:45 +00:00
serve:
2014-11-01 01:34:50 +00:00
${SERVER} public -H '{"Cache-Control": "no-cache, must-revalidate"}'
2014-08-29 02:55:45 +00:00
2014-10-27 03:10:41 +00:00
# Make a minified package.
build:
2014-11-01 01:34:50 +00:00
${GRUNT} init
${MAKE} build-js
${MAKE} build-css
${GRUNT} minify
build-js:
${BROWSERIFY} -e ./src/app.coffee -o public/js/app.bundle.js
# Use less on index style.
build-css:
${LESS} src/styles/burnchart.less > public/css/app.bundle.css
2014-10-27 03:10:41 +00:00
2014-10-27 12:57:57 +00:00
# Publish to GitHub Pages.
2014-10-27 03:10:41 +00:00
publish:
2014-11-01 01:34:50 +00:00
${GRUNT} gh-pages
2014-10-29 04:30:42 +00:00
2014-10-30 02:53:44 +00:00
OPTS = --compilers coffee:coffee-script/register --ui exports
2014-10-27 03:10:41 +00:00
# Run mocha test.
test:
2014-11-01 01:34:50 +00:00
${MOCHA} ${OPTS} --reporter spec
2014-10-29 04:30:42 +00:00
# Run code coverage.
coverage:
2014-11-01 01:34:50 +00:00
${MOCHA} ${OPTS} --reporter html-cov --require blanket > docs/COVERAGE.html
2014-10-29 04:30:42 +00:00
# Run code coverage and publish to coveralls.
coveralls:
2014-11-01 01:34:50 +00:00
${MOCHA} ${OPTS} --reporter mocha-lcov-reporter --require blanket | COVERALLS_REPO_TOKEN=$(TOKEN) COVERALLS_SERVICE_NAME=MOCHA ${COVERALLS}
2014-10-27 03:10:41 +00:00
.PHONY: test