Commit 73769fe2 authored by Nick Stenning's avatar Nick Stenning

Clean up Makefile

This commit moves a couple of helper tasks for developing the frontend
into the gulpfile, and also improves the automatic installation of
dependencies and building of assets.

All that is now required to get a running development server (with built
frontend assets) from a fresh checkout of the repository is:

    make dev

Subsequent runs of `make dev` will ensure the JavaScript and Python
dependencies are up-to-date but will not rebuild the assets unless they
are either explicitly cleaned,

    make clean dev

or the developer runs the gulp `watch` task independently (recommended).

Similarly, from a fresh checkout, it should be possible to run the test
suite simply by running:

    make test

Note that this commit removes `gulp-cli` and `karma-cli` from the
package dependencies -- these packages are not intended to be installed
in a software distribution, although they can both be installed globally
to assist with easier dispatch of gulp/karma tasks if needed:

    npm install -g gulp-cli karma-cli
parent ed63661d
...@@ -10,6 +10,7 @@ var endOfStream = require('end-of-stream'); ...@@ -10,6 +10,7 @@ var endOfStream = require('end-of-stream');
var gulp = require('gulp'); var gulp = require('gulp');
var gulpIf = require('gulp-if'); var gulpIf = require('gulp-if');
var gulpUtil = require('gulp-util'); var gulpUtil = require('gulp-util');
var karma = require('karma');
var sass = require('gulp-sass'); var sass = require('gulp-sass');
var postcss = require('gulp-postcss'); var postcss = require('gulp-postcss');
var sourcemaps = require('gulp-sourcemaps'); var sourcemaps = require('gulp-sourcemaps');
...@@ -216,3 +217,29 @@ gulp.task('watch', ...@@ -216,3 +217,29 @@ gulp.task('watch',
'watch-fonts', 'watch-fonts',
'watch-images', 'watch-images',
'watch-manifest']); 'watch-manifest']);
gulp.task('test-app', function (callback) {
new karma.Server({
configFile: __dirname + '/h/static/scripts/karma.config.js',
singleRun: true,
}, callback).start();
});
gulp.task('test-extension', function (callback) {
new karma.Server({
configFile: __dirname + '/h/browser/chrome/karma.config.js',
singleRun: true,
}, callback).start();
});
gulp.task('test-watch-app', function (callback) {
new karma.Server({
configFile: __dirname + '/h/static/scripts/karma.config.js',
}, callback).start();
});
gulp.task('test-watch-extension', function (callback) {
new karma.Server({
configFile: __dirname + '/h/browser/chrome/karma.config.js',
}, callback).start();
});
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-batch": "^1.0.5", "gulp-batch": "^1.0.5",
"gulp-changed": "^1.3.0", "gulp-changed": "^1.3.0",
"gulp-cli": "^1.2.1",
"gulp-if": "^2.0.0", "gulp-if": "^2.0.0",
"gulp-postcss": "^6.1.0", "gulp-postcss": "^6.1.0",
"gulp-sass": "^2.2.0", "gulp-sass": "^2.2.0",
...@@ -71,7 +70,6 @@ ...@@ -71,7 +70,6 @@
"karma": "^0.13.10", "karma": "^0.13.10",
"karma-browserify": "^3.0.3", "karma-browserify": "^3.0.3",
"karma-chai": "^0.1.0", "karma-chai": "^0.1.0",
"karma-cli": "0.0.4",
"karma-mocha": "^0.1.4", "karma-mocha": "^0.1.4",
"karma-ng-html2js-preprocessor": "^0.1.0", "karma-ng-html2js-preprocessor": "^0.1.0",
"karma-phantomjs-launcher": "^0.1.4", "karma-phantomjs-launcher": "^0.1.4",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment