11var deepmerge = require ( 'deepmerge' ) ;
22
33module . exports = function ( grunt ) {
4+ require ( 'time-grunt' ) ( grunt ) ;
5+ require ( 'jit-grunt' ) ( grunt ) ;
6+
47 grunt . util . linefeed = '\n' ;
58
69 function removeJshint ( src ) {
@@ -62,7 +65,7 @@ module.exports = function(grunt) {
6265
6366 ( function ( ) {
6467 // list available plugins and languages
65- grunt . file . expand ( 'src/plugins/*/plugin.js' )
68+ grunt . file . expand ( 'src/plugins/** /plugin.js' )
6669 . forEach ( function ( f ) {
6770 var n = f . split ( '/' ) [ 2 ] ;
6871 all_plugins [ n ] = f ;
@@ -209,7 +212,7 @@ module.exports = function(grunt) {
209212 }
210213 }
211214 } ,
212- // compile language files
215+ // compile language files with AMD wrapper
213216 lang : {
214217 files : Object . keys ( all_langs ) . map ( function ( name ) {
215218 return {
@@ -218,13 +221,13 @@ module.exports = function(grunt) {
218221 } ;
219222 } ) ,
220223 options : {
221- stripBanners : false ,
222224 process : function ( src , file ) {
223225 var wrapper = grunt . file . read ( 'src/i18n/.wrapper.js' ) . replace ( / \r \n / g, '\n' ) . split ( / @ @ j s \n / ) ;
224226 return process_lang ( file , src , wrapper ) ;
225227 }
226228 }
227229 } ,
230+ // compîle language files without wrapper
228231 lang_temp : {
229232 files : Object . keys ( all_langs ) . map ( function ( name ) {
230233 return {
@@ -233,7 +236,6 @@ module.exports = function(grunt) {
233236 } ;
234237 } ) ,
235238 options : {
236- stripBanners : false ,
237239 process : function ( src , file ) {
238240 return process_lang ( file , src ) ;
239241 }
@@ -242,7 +244,6 @@ module.exports = function(grunt) {
242244 // add banner to CSS files
243245 css : {
244246 options : {
245- stripBanners : { block : true } ,
246247 banner : '<%= banner %>\n\n' ,
247248 } ,
248249 files : [ {
@@ -254,7 +255,7 @@ module.exports = function(grunt) {
254255 } ,
255256
256257 wrap : {
257- // add AMD wrapper
258+ // add AMD wrapper and banner
258259 js : {
259260 src : [ 'dist/js/query-builder.js' ] ,
260261 dest : '' ,
@@ -346,7 +347,9 @@ module.exports = function(grunt) {
346347 } ,
347348
348349 // clean build dir
349- clean : [ '.temp' ] ,
350+ clean : {
351+ temp : [ '.temp' ]
352+ } ,
350353
351354 // jshint tests
352355 jshint : {
@@ -487,28 +490,13 @@ module.exports = function(grunt) {
487490 } ) ;
488491
489492
490- grunt . loadNpmTasks ( 'grunt-contrib-uglify' ) ;
491- grunt . loadNpmTasks ( 'grunt-contrib-copy' ) ;
492- grunt . loadNpmTasks ( 'grunt-contrib-cssmin' ) ;
493- grunt . loadNpmTasks ( 'grunt-contrib-concat' ) ;
494- grunt . loadNpmTasks ( 'grunt-contrib-qunit' ) ;
495- grunt . loadNpmTasks ( 'grunt-contrib-jshint' ) ;
496- grunt . loadNpmTasks ( 'grunt-contrib-watch' ) ;
497- grunt . loadNpmTasks ( 'grunt-qunit-blanket-lcov' ) ;
498- grunt . loadNpmTasks ( 'grunt-string-replace' ) ;
499- grunt . loadNpmTasks ( 'grunt-contrib-clean' ) ;
500- grunt . loadNpmTasks ( 'grunt-contrib-sass' ) ;
501- grunt . loadNpmTasks ( 'grunt-coveralls' ) ;
502- grunt . loadNpmTasks ( 'grunt-wrap' ) ;
503- grunt . loadNpmTasks ( 'grunt-bump' ) ;
504-
505493 grunt . registerTask ( 'build_js' , [
506494 'concat:lang_temp' ,
507495 'concat:js' ,
508496 'wrap:js' ,
509497 'concat:js_standalone' ,
510498 'uglify' ,
511- 'clean'
499+ 'clean:temp '
512500 ] ) ;
513501
514502 grunt . registerTask ( 'build_css' , [
0 commit comments