forked from avoronkin/angular-spectrum-colorpicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
98 lines (86 loc) · 2.26 KB
/
Gruntfile.js
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/**
* Build instructions for grunt.
*
* @param {Object} grunt
* @return {void}
*/
module.exports = function(grunt) {
'use strict';
var Helpers = require('./tasks/helpers');
var config = Helpers.config;
var _ = grunt.util._;
/* Task configuration is in ./tasks/options - load here */
config = _.extend(config, Helpers.loadConfig('./tasks/options/'));
/* Load grunt tasks from NPM packages */
require('load-grunt-tasks')(grunt);
grunt.loadTasks('tasks');
grunt.registerTask(
'tdd',
'Watch source and test files and execute tests on change',
function(suite) {
var tasks = [];
var watcher = '';
if (!suite || suite === 'unit') {
tasks.push('karma:watch:start');
watcher = 'watch:andtestunit';
}
if (!suite || suite === 'e2e') {
tasks.push('connect:test', 'shell:startsilenium');
watcher = 'watch:andteste2e';
}
if (!suite) {
watcher = 'watch:andtestboth';
}
tasks.push(watcher);
grunt.task.run(tasks);
}
);
grunt.registerTask('demo', 'Start the demo app', [
'connect:demo',
'shell:opendemo',
'parallel:watchdemo'
]);
grunt.registerTask('coverage', 'Serve coverage report', ['connect:coverage']);
grunt.registerTask(
'test',
'Execute all the tests',
function(suite) {
var tasks = ['jshint', 'ngtemplates'];
if (!suite || suite === 'unit') {
process.env.defaultBrowsers = 'Firefox,Chrome';
tasks.push('shell:deleteCoverages', 'karma:all');
}
if (!suite || suite === 'e2e') {
tasks.push('connect:test', 'protractor:single');
}
grunt.task.run(tasks);
}
);
grunt.registerTask(
'build',
'Build dist files',
[
'ngtemplates',
/*
'less:dist',
'less:distmin',
'concat:bannerToDistStyle',
'concat:bannerToDistStyleMin',
*/
'concat:dist',
'ngAnnotate:dist',
'uglify'
]
);
grunt.registerTask('release', 'Test, bump, build and release.', function(type) {
grunt.task.run([
'test',
'npm-contributors',
'bump-only:' + (type || 'patch'),
'build',
'bump-commit'
]);
});
grunt.registerTask('default', 'Test', ['test']);
grunt.initConfig(config);
};