-
Notifications
You must be signed in to change notification settings - Fork 45
/
Gruntfile.js
64 lines (52 loc) · 1.93 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
/**
* Build instructions for grunt.
*
* Structure seen in [rprtr](https://github.com/mrmrs/rprtr)
* by [aputinski](https://github.com/aputinski)
*
* @param {Object} grunt
* @return {void}
*/
module.exports = function(grunt) {
'use strict';
var Helpers = require('./tasks/helpers');
var config = Helpers.config;
var _ = grunt.util._;
config = _.extend(config, Helpers.loadConfig('./tasks/options/'));
/* Load grunt tasks from NPM packages */
require('load-grunt-tasks')(grunt);
grunt.loadTasks('tasks');
/* "Helper" Tasks */
grunt.registerTask('_protractor:start', ['http-server:test', 'protractor']);
grunt.registerTask('_test:beforeEach', ['jshint']);
/* "Public" Tasks */
/* Alias for starting the demo server */
grunt.registerTask('demo', ['http-server:demo']);
/* Watch source and test files and execute karma unit tests on change. */
grunt.registerTask('watch:start', ['karma:watch:start', 'watch:andtest']);
/* Execute all tests. */
grunt.registerTask('test', ['_test:beforeEach', 'karma:all', '_protractor:start']);
/* Execute e2e tests. */
grunt.registerTask('test:e2e', ['_test:beforeEach', '_protractor:start']);
/* Execute unit tests. */
grunt.registerTask('test:unit', ['_test:beforeEach', 'karma:all']);
/* Execute karma tests with Firefox and PhantomJS. */
grunt.registerTask('test:travis', ['_test:beforeEach', 'karma:travis']);
/* Build dist files. */
grunt.registerTask('build', ['concat:dist', 'uglify']);
/* Distribute a new version. */
grunt.registerTask('dist', function() {
grunt.log.errorlns('deprecated, please use `grunt release`');
});
grunt.registerTask('release', 'Test, bump, build and release.', function(type) {
grunt.task.run([
'test',
'bump-only:' + (type || 'patch'),
'build',
'bump-commit'
]);
});
/* test and build by default. */
grunt.registerTask('default', ['test', 'build']);
grunt.initConfig(config);
};