@@ -217,25 +217,25 @@ module.exports = function(grunt) {
217
217
} ) ;
218
218
219
219
// These plugins provide necessary tasks.
220
+ grunt . loadNpmTasks ( 'grunt-contrib-clean' ) ;
220
221
grunt . loadNpmTasks ( 'grunt-contrib-concat' ) ;
222
+ grunt . loadNpmTasks ( 'grunt-contrib-copy' ) ;
221
223
grunt . loadNpmTasks ( 'grunt-contrib-jshint' ) ;
222
224
grunt . loadNpmTasks ( 'grunt-contrib-watch' ) ;
223
- grunt . loadNpmTasks ( 'grunt-contrib-clean' ) ;
224
- grunt . loadNpmTasks ( 'grunt-contrib-copy' ) ;
225
225
grunt . loadNpmTasks ( 'grunt-include-replace' ) ;
226
226
227
227
// Default task.
228
228
grunt . registerTask ( 'default' , [ 'test' ] ) ;
229
-
230
- //Alias for
229
+
230
+ //Alias for
231
231
grunt . registerTask ( 'lint' , [ 'jshint' ] ) ;
232
-
232
+
233
233
//Testing
234
234
grunt . registerTask ( 'test' , [ 'clean:build' , 'jshint' , 'concat' , 'yuitest' ] ) ;
235
235
grunt . registerTask ( 'rhino' , [ 'clean:build' , 'jshint' , 'concat' , 'test_rhino' ] ) ;
236
236
237
237
grunt . registerTask ( 'release' , [ 'test' , 'clean:release' , 'copy:release' , 'includereplace:release' , 'changelog' ] ) ;
238
-
238
+
239
239
//Run the YUITest suite
240
240
grunt . registerMultiTask ( 'yuitest' , 'Run the YUITests for the project' , function ( ) {
241
241
/*jshint evil:true, node: true */
@@ -249,12 +249,12 @@ module.exports = function(grunt) {
249
249
var errors = [ ] ,
250
250
failures = [ ] ,
251
251
stack = [ ] ;
252
-
252
+
253
253
//Eval each file so the tests are brought into this scope where CSSLint and YUITest are loaded already
254
254
files . forEach ( function ( filepath ) {
255
255
eval ( grunt . file . read ( filepath ) ) ;
256
256
} ) ;
257
-
257
+
258
258
// From YUITest Node CLI
259
259
function filterStackTrace ( stackTrace ) {
260
260
if ( stackTrace ) {
@@ -276,7 +276,7 @@ module.exports = function(grunt) {
276
276
return "Unavailable." ;
277
277
}
278
278
}
279
-
279
+
280
280
// From YUITest Node CLI with minor colourization changes
281
281
function handleEvent ( event ) {
282
282
@@ -387,8 +387,8 @@ module.exports = function(grunt) {
387
387
var done = this . async ( ) ;
388
388
var lastTag ;
389
389
var files = this . filesSrc ;
390
-
391
-
390
+
391
+
392
392
grunt . util . spawn ( {
393
393
cmd : 'git' ,
394
394
args : [ 'tag' ]
@@ -399,26 +399,26 @@ module.exports = function(grunt) {
399
399
major = parseInt ( semver [ 0 ] , 10 ) ,
400
400
minor = parseInt ( semver [ 1 ] , 10 ) ,
401
401
patch = parseInt ( semver [ 2 ] , 10 ) ;
402
-
403
- //A simple array sort can't be used because of the comparison of
402
+
403
+ //A simple array sort can't be used because of the comparison of
404
404
//the strings '0.9.9' > '0.9.10'
405
405
for ( var i = 1 , len = tags . length ; i < len ; i ++ ) {
406
406
semver = tags [ i ] . replace ( 'v' , '' ) . split ( '.' ) ;
407
-
407
+
408
408
var currentMajor = parseInt ( semver [ 0 ] , 10 ) ;
409
409
if ( currentMajor < major ) {
410
410
continue ;
411
411
} else if ( currentMajor > major ) {
412
412
major = currentMajor ;
413
413
}
414
-
414
+
415
415
var currentMinor = parseInt ( semver [ 1 ] , 10 ) ;
416
416
if ( currentMinor < minor ) {
417
417
continue ;
418
418
} else if ( currentMinor > minor ) {
419
419
minor = currentMinor ;
420
420
}
421
-
421
+
422
422
var currentPatch = parseInt ( semver [ 2 ] , 10 ) ;
423
423
if ( currentPatch < patch ) {
424
424
continue ;
@@ -428,9 +428,9 @@ module.exports = function(grunt) {
428
428
}
429
429
430
430
lastTag = 'v' + major + '.' + minor + '.' + patch ;
431
-
431
+
432
432
grunt . verbose . write ( 'Last tag: ' + lastTag ) . writeln ( ) ;
433
-
433
+
434
434
//
435
435
grunt . util . spawn ( {
436
436
cmd : 'git' ,
@@ -445,9 +445,9 @@ module.exports = function(grunt) {
445
445
grunt . file . read ( files [ 0 ] ) ;
446
446
447
447
grunt . file . write ( files [ 0 ] , grunt . template . process ( template ) ) ;
448
-
448
+
449
449
done ( ) ;
450
- } ) ;
450
+ } ) ;
451
451
} ) ;
452
452
453
453
} ) ;
@@ -457,13 +457,13 @@ module.exports = function(grunt) {
457
457
var done = this . async ( ) ;
458
458
var files = this . filesSrc ;
459
459
var progress = files . length ;
460
-
460
+
461
461
files . forEach ( function ( filepath ) {
462
462
grunt . util . spawn ( {
463
463
cmd : 'java' ,
464
464
args : [ '-jar' , 'lib/js.jar' , 'lib/yuitest-rhino-cli.js' , 'build/csslint.js' , filepath ] ,
465
465
opts : { stdio : 'inherit' }
466
- } , function ( error , result , code ) {
466
+ } , function ( error , result , code ) {
467
467
progress -- ;
468
468
if ( progress === 0 ) {
469
469
done ( ) ;
0 commit comments