burnchart/Makefile

53 lines
1.2 KiB
Makefile
Raw Normal View History

2014-10-29 04:30:42 +00: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-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-10-29 04:30:42 +00:00
$(MAKE) watch-js & $(MAKE) watch-css
# Watch the app.
watch-js:
2014-10-30 01:52:58 +00:00
$(WATCH) -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-10-31 00:36:40 +00:00
$(GRUNT) css # first build
$(GRUNT) watch # then watch
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-10-29 04:30:42 +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-10-29 04:30:42 +00:00
$(GRUNT) init
$(BROWSERIFY) -e ./src/app.coffee -o public/js/app.bundle.js
$(GRUNT) css
$(GRUNT) minify
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-10-29 04:30:42 +00:00
$(GRUNT) gh-pages
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-10-29 05:02:38 +00:00
$(MOCHA) $(OPTS) --reporter spec
2014-10-29 04:30:42 +00:00
# Run code coverage.
coverage:
2014-10-29 05:02:38 +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-10-29 05:02:38 +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