burnchart/Makefile

52 lines
1.2 KiB
Makefile
Raw Normal View History

2014-10-28 22:30:42 -06:00
BROWSERIFY = ./node_modules/.bin/browserify
WATCH = ./node_modules/.bin/watchify
SERVER = ./node_modules/.bin/static
MOCHA = ./node_modules/.bin/mocha
COVERALLS = ./node_modules/.bin/coveralls
GRUNT = grunt
2014-10-26 19:57:44 -07:00
# Install dependencies.
2014-08-28 19:55:45 -07:00
install:
npm install
2014-10-26 21:10:41 -06:00
watch:
2014-10-28 22:30:42 -06:00
$(MAKE) watch-js & $(MAKE) watch-css
# Watch the app.
watch-js:
2014-10-29 19:52:58 -06:00
$(WATCH) -e ./src/app.coffee -o public/js/app.bundle.js -d -v
2014-10-28 22:30:42 -06:00
# Watch the styles.
watch-css:
$(GRUNT) watch
2014-08-28 19:55:45 -07:00
2014-10-26 19:57:44 -07:00
# Serve locally.
2014-08-28 19:55:45 -07:00
serve:
2014-10-28 22:30:42 -06:00
$(SERVER) public -H '{"Cache-Control": "no-cache, must-revalidate"}'
2014-08-28 19:55:45 -07:00
2014-10-26 21:10:41 -06:00
# Make a minified package.
build:
2014-10-28 22:30:42 -06:00
$(GRUNT) init
$(BROWSERIFY) -e ./src/app.coffee -o public/js/app.bundle.js
$(GRUNT) css
$(GRUNT) minify
2014-10-26 21:10:41 -06:00
2014-10-27 06:57:57 -06:00
# Publish to GitHub Pages.
2014-10-26 21:10:41 -06:00
publish:
2014-10-28 22:30:42 -06:00
$(GRUNT) gh-pages
2014-10-29 20:53:44 -06:00
OPTS = --compilers coffee:coffee-script/register --ui exports
2014-10-26 21:10:41 -06:00
# Run mocha test.
test:
2014-10-28 23:02:38 -06:00
$(MOCHA) $(OPTS) --reporter spec
2014-10-28 22:30:42 -06:00
# Run code coverage.
coverage:
2014-10-28 23:02:38 -06:00
$(MOCHA) $(OPTS) --reporter html-cov --require blanket > docs/COVERAGE.html
2014-10-28 22:30:42 -06:00
# Run code coverage and publish to coveralls.
coveralls:
2014-10-28 23:02:38 -06:00
$(MOCHA) $(OPTS) --reporter mocha-lcov-reporter --require blanket | COVERALLS_REPO_TOKEN=$(TOKEN) COVERALLS_SERVICE_NAME=MOCHA $(COVERALLS)
2014-10-26 21:10:41 -06:00
.PHONY: test