Move buildList into build task function.
Showing
1 changed file
with
45 additions
and
48 deletions
... | @@ -83,16 +83,6 @@ module.exports = function (grunt) { | ... | @@ -83,16 +83,6 @@ module.exports = function (grunt) { |
83 | }; | 83 | }; |
84 | } | 84 | } |
85 | var checkList = []; | 85 | var checkList = []; |
86 | var buildList = [ | ||
87 | 'check', | ||
88 | 'clean:montyPython', | ||
89 | 'post-clean', | ||
90 | ]; | ||
91 | var postCleanList = []; | ||
92 | |||
93 | grunt.registerTask('post-clean', 'post-clean', function() { | ||
94 | grunt.task.run(postCleanList); | ||
95 | }); | ||
96 | 86 | ||
97 | function externalMultiTask(name, desc, command, updateOptions) { | 87 | function externalMultiTask(name, desc, command, updateOptions) { |
98 | grunt.log.writeln('registering multiTask', name); | 88 | grunt.log.writeln('registering multiTask', name); |
... | @@ -200,7 +190,6 @@ module.exports = function (grunt) { | ... | @@ -200,7 +190,6 @@ module.exports = function (grunt) { |
200 | generate: { | 190 | generate: { |
201 | }, | 191 | }, |
202 | }; | 192 | }; |
203 | buildList.push('punch:generate'); | ||
204 | htmlSourceDir = '.grunt/holygrail/punch/output-generate'; | 193 | htmlSourceDir = '.grunt/holygrail/punch/output-generate'; |
205 | initConfig.copy.dist.files.push({ | 194 | initConfig.copy.dist.files.push({ |
206 | expand: true, | 195 | expand: true, |
... | @@ -428,42 +417,6 @@ module.exports = function (grunt) { | ... | @@ -428,42 +417,6 @@ module.exports = function (grunt) { |
428 | }; | 417 | }; |
429 | } | 418 | } |
430 | 419 | ||
431 | buildList.push('useminPrepare'); // html | ||
432 | //buildList.push('usemin:views' | ||
433 | if (mpConfig.bower) { | ||
434 | buildList.push('requirejs'); // script | ||
435 | } | ||
436 | buildList.push('copy:css'); // css | ||
437 | if (mpConfig.images) { | ||
438 | buildList.push('imagemin'); // image | ||
439 | buildList.push('svgmin'); // image | ||
440 | if (mpConfig.useRev) { | ||
441 | buildList.push('rev:img'); // image | ||
442 | } | ||
443 | } | ||
444 | //buildList.push('autoprefixer'); // css | ||
445 | buildList.push('concat:generated'); // montyPython | ||
446 | buildList.push('cssmin'); // montyPython | ||
447 | //'uglify:dist'); | ||
448 | buildList.push('copy:dist'); | ||
449 | //'modernizr'); | ||
450 | //buildList.push('uglify:generated'); // montyPython | ||
451 | if (mpConfig.useRev) { | ||
452 | buildList.push('rev:dist'); // montyPython | ||
453 | buildList.push('rev:css'); // montyPython | ||
454 | buildList.push('revconfig'); // montyPython | ||
455 | } | ||
456 | if (mpConfig.bower) { | ||
457 | buildList.push('concat:requirejs'); // montyPython | ||
458 | } | ||
459 | if (mpConfig.useRev) { | ||
460 | buildList.push('rev:requirejs'); | ||
461 | } | ||
462 | //buildList.push('uglify:bower'); // montyPython | ||
463 | //buildList.push('uglify:requireconfig'); // montyPython | ||
464 | buildList.push('usemin:html'); // montyPython | ||
465 | buildList.push('usemin:css'); // montyPython | ||
466 | buildList.push('htmlmin'); // montyPython | ||
467 | 420 | ||
468 | grunt.initConfig(initConfig); | 421 | grunt.initConfig(initConfig); |
469 | 422 | ||
... | @@ -474,6 +427,10 @@ module.exports = function (grunt) { | ... | @@ -474,6 +427,10 @@ module.exports = function (grunt) { |
474 | ]); | 427 | ]); |
475 | 428 | ||
476 | grunt.registerTask('build', 'build the system', function() { | 429 | grunt.registerTask('build', 'build the system', function() { |
430 | var buildList = [ | ||
431 | 'check', | ||
432 | 'clean:montyPython', | ||
433 | ]; | ||
477 | var featureFlags = {}; | 434 | var featureFlags = {}; |
478 | if (arguments.length) { | 435 | if (arguments.length) { |
479 | for (var i in arguments) { | 436 | for (var i in arguments) { |
... | @@ -494,8 +451,48 @@ module.exports = function (grunt) { | ... | @@ -494,8 +451,48 @@ module.exports = function (grunt) { |
494 | } | 451 | } |
495 | grunt.file.write('.grunt/holygrail/scripts/featureFlags.js', lines.join('\n')); | 452 | grunt.file.write('.grunt/holygrail/scripts/featureFlags.js', lines.join('\n')); |
496 | }); | 453 | }); |
497 | postCleanList.add('writeFeatureFlags'); | 454 | buildList.add('writeFeatureFlags'); |
455 | } | ||
456 | |||
457 | if (mpConfig.punch) { | ||
458 | buildList.push('punch:generate'); | ||
459 | } | ||
460 | buildList.push('useminPrepare'); // html | ||
461 | //buildList.push('usemin:views' | ||
462 | if (mpConfig.bower) { | ||
463 | buildList.push('requirejs'); // script | ||
464 | } | ||
465 | buildList.push('copy:css'); // css | ||
466 | if (mpConfig.images) { | ||
467 | buildList.push('imagemin'); // image | ||
468 | buildList.push('svgmin'); // image | ||
469 | if (mpConfig.useRev) { | ||
470 | buildList.push('rev:img'); // image | ||
471 | } | ||
472 | } | ||
473 | //buildList.push('autoprefixer'); // css | ||
474 | buildList.push('concat:generated'); // montyPython | ||
475 | buildList.push('cssmin'); // montyPython | ||
476 | //'uglify:dist'); | ||
477 | buildList.push('copy:dist'); | ||
478 | //'modernizr'); | ||
479 | //buildList.push('uglify:generated'); // montyPython | ||
480 | if (mpConfig.useRev) { | ||
481 | buildList.push('rev:dist'); // montyPython | ||
482 | buildList.push('rev:css'); // montyPython | ||
483 | buildList.push('revconfig'); // montyPython | ||
484 | } | ||
485 | if (mpConfig.bower) { | ||
486 | buildList.push('concat:requirejs'); // montyPython | ||
487 | } | ||
488 | if (mpConfig.useRev) { | ||
489 | buildList.push('rev:requirejs'); | ||
498 | } | 490 | } |
491 | //buildList.push('uglify:bower'); // montyPython | ||
492 | //buildList.push('uglify:requireconfig'); // montyPython | ||
493 | buildList.push('usemin:html'); // montyPython | ||
494 | buildList.push('usemin:css'); // montyPython | ||
495 | buildList.push('htmlmin'); // montyPython | ||
499 | 496 | ||
500 | grunt.task.run(buildList); | 497 | grunt.task.run(buildList); |
501 | }); | 498 | }); | ... | ... |
-
Please register or sign in to post a comment