grunt-contrib-watch/Gruntfile.js

57 lines
1.3 KiB
JavaScript
Raw Normal View History

2012-10-17 06:25:07 +08:00
/*
* grunt-contrib-watch
* http://gruntjs.com/
*
2016-01-05 09:17:42 +08:00
* Copyright (c) 2016 "Cowboy" Ben Alman, contributors
2012-10-17 06:25:07 +08:00
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/**/*.js',
'<%= nodeunit.tests %>',
2012-10-17 06:25:07 +08:00
],
options: {
jshintrc: '.jshintrc',
},
2012-10-17 06:25:07 +08:00
},
2014-11-04 09:38:53 +08:00
jscs: {
src: ['tasks/**/*.js', 'test/tasks/**/*.js'],
options: {
config: '.jscsrc'
}
},
2012-10-17 06:25:07 +08:00
watch: {
all: {
files: ['<%= jshint.all %>'],
2013-04-17 12:41:03 +08:00
tasks: ['jshint', 'nodeunit'],
},
2012-10-17 06:25:07 +08:00
},
nodeunit: {
tests: ['test/tasks/*_test.js'],
},
});
2012-10-17 06:25:07 +08:00
// Dynamic alias task to nodeunit. Run individual tests with: grunt test:events
grunt.registerTask('test', function(file) {
grunt.task.run('jshint');
2014-11-04 09:38:53 +08:00
grunt.task.run('jscs');
grunt.config('nodeunit.tests', String(grunt.config('nodeunit.tests')).replace('*', file || '*'));
grunt.task.run('nodeunit');
2012-10-17 06:25:07 +08:00
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-internal');
2014-11-04 09:38:53 +08:00
grunt.loadNpmTasks('grunt-jscs');
2012-10-17 06:25:07 +08:00
grunt.registerTask('default', ['test', 'build-contrib']);
2012-10-17 06:25:07 +08:00
};