2013-05-31 02:33:12 +00:00
|
|
|
/*!
|
|
|
|
* Grunt file
|
|
|
|
*
|
|
|
|
* @package VisualEditor
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*jshint node:true */
|
|
|
|
module.exports = function ( grunt ) {
|
2013-12-19 23:07:19 +00:00
|
|
|
var modules = grunt.file.readJSON( 'lib/ve/build/modules.json' );
|
2013-05-31 02:33:12 +00:00
|
|
|
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-csslint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2014-04-04 22:22:57 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2013-12-06 02:34:44 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-jscs-checker' );
|
2013-12-19 23:07:19 +00:00
|
|
|
grunt.loadTasks( 'lib/ve/build/tasks' );
|
2013-12-14 23:04:08 +00:00
|
|
|
grunt.loadTasks( 'build/tasks' );
|
2013-05-31 02:33:12 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
|
|
|
pkg: grunt.file.readJSON( 'package.json' ),
|
2013-12-19 23:07:19 +00:00
|
|
|
jsduckcatconfig: {
|
|
|
|
main: {
|
|
|
|
target: '.docs/categories.json',
|
|
|
|
from: [
|
|
|
|
'.docs/mw-categories.json',
|
|
|
|
{
|
|
|
|
file: 'lib/ve/.docs/categories.json',
|
|
|
|
aggregate: {
|
|
|
|
'VisualEditor (core)': [
|
|
|
|
'General',
|
|
|
|
'Initialization',
|
|
|
|
'DataModel',
|
|
|
|
'ContentEditable',
|
|
|
|
'User Interface',
|
|
|
|
'Tests'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
include: ['UnicodeJS', 'OOJS UI', 'Upstream']
|
2013-12-19 01:07:54 +00:00
|
|
|
}
|
2013-12-19 23:07:19 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
buildloader: {
|
|
|
|
egiframe: {
|
|
|
|
target: '.docs/eg-iframe.html',
|
|
|
|
template: '.docs/eg-iframe.html.template',
|
2013-12-14 23:04:08 +00:00
|
|
|
modules: modules,
|
2014-01-16 20:31:15 +00:00
|
|
|
pathPrefix: 'lib/ve/',
|
2013-12-14 23:04:08 +00:00
|
|
|
indent: '\t\t'
|
|
|
|
}
|
|
|
|
},
|
2013-05-31 02:33:12 +00:00
|
|
|
jshint: {
|
2013-12-18 05:08:36 +00:00
|
|
|
options: {
|
|
|
|
jshintrc: '.jshintrc'
|
|
|
|
},
|
2013-12-18 04:33:22 +00:00
|
|
|
all: [
|
|
|
|
'*.js',
|
2013-12-19 23:07:19 +00:00
|
|
|
'{.docs,build}/**/*.js',
|
2013-12-19 20:28:07 +00:00
|
|
|
'modules/**/*.js'
|
2013-12-18 04:33:22 +00:00
|
|
|
]
|
2013-05-31 02:33:12 +00:00
|
|
|
},
|
2013-12-06 02:34:44 +00:00
|
|
|
jscs: {
|
|
|
|
src: [
|
2014-02-20 19:59:37 +00:00
|
|
|
'<%= jshint.all %>'
|
2013-12-06 02:34:44 +00:00
|
|
|
]
|
|
|
|
},
|
2013-05-31 02:33:12 +00:00
|
|
|
csslint: {
|
|
|
|
options: {
|
|
|
|
csslintrc: '.csslintrc'
|
|
|
|
},
|
2013-12-18 04:33:22 +00:00
|
|
|
all: [
|
2014-02-20 19:59:37 +00:00
|
|
|
'modules/*/**/*.css'
|
2013-12-18 04:33:22 +00:00
|
|
|
],
|
2013-05-31 02:33:12 +00:00
|
|
|
},
|
2014-04-04 22:22:57 +00:00
|
|
|
banana: {
|
|
|
|
all: 'modules/ve-{mw,wmf}/i18n/'
|
|
|
|
},
|
2013-05-31 02:33:12 +00:00
|
|
|
watch: {
|
2013-12-18 04:33:22 +00:00
|
|
|
files: [
|
|
|
|
'.{jshintrc,jscs.json,jshintignore,csslintrc}',
|
|
|
|
'<%= jshint.all %>',
|
2013-12-19 23:07:19 +00:00
|
|
|
'<%= csslint.all %>'
|
2013-12-18 04:33:22 +00:00
|
|
|
],
|
2013-05-31 02:33:12 +00:00
|
|
|
tasks: ['test']
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2013-12-19 23:07:19 +00:00
|
|
|
grunt.registerTask( 'build', ['jsduckcatconfig', 'buildloader'] );
|
2014-04-04 22:22:57 +00:00
|
|
|
grunt.registerTask( 'lint', ['jshint', 'jscs', 'csslint', 'banana' ] );
|
2014-04-04 20:48:00 +00:00
|
|
|
grunt.registerTask( 'test', ['build', 'lint'] );
|
|
|
|
grunt.registerTask( 'default', ['test'] );
|
2013-05-31 02:33:12 +00:00
|
|
|
};
|