This repository was archived by the owner on Feb 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGruntfile.js
More file actions
51 lines (43 loc) · 1.7 KB
/
Gruntfile.js
File metadata and controls
51 lines (43 loc) · 1.7 KB
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
'use strict';
module.exports = function (grunt) {
// Load the project's grunt tasks from a directory
require('grunt-config-dir')(grunt, {
configDir: require('path').resolve('tasks')
});
// handle coverage event by sending data to coveralls
grunt.event.on('coverage', function(lcov, done){
require('coveralls').handleInput(lcov, function(err){
if (err) {
return done(err);
}
done();
});
});
/*
* Register group tasks
*/
//npm install
grunt.registerTask('npm_install', 'install dependencies', function() {
var exec = require('child_process').exec;
var cb = this.async();
exec('npm install', {cwd: './'}, function(err, stdout) {
console.log(stdout);
cb();
});
});
grunt.registerTask('open_coverage', 'open coverage report in default browser', function() {
var exec = require('child_process').exec;
var cb = this.async();
exec('open coverage/lcov-report/index.html', {cwd: './'}, function(err, stdout) {
console.log(stdout);
cb();
});
});
grunt.registerTask('clean_all', ['clean:node_modules', 'clean:coverage', 'clean:docs', 'npm_install']);
grunt.registerTask('test', ['env:test', 'clean:coverage', 'jscs:all', 'jshint', 'mocha_istanbul']);
grunt.registerTask('coverage', ['test', 'open_coverage']);
grunt.registerTask('generate-docs', ['clean:docs', 'apidoc']);
grunt.registerTask('dist', ['compress:hmda-edit-check-api']);
grunt.registerTask('serve', ['env:sandbox', 'jshint','develop','watch']);
grunt.registerTask('codedeploy', ['compress:codedeploy']);
};