a421f05b by Adam Heath

Move buildList into build task function.

1 parent b925f472
......@@ -83,16 +83,6 @@ module.exports = function (grunt) {
};
}
var checkList = [];
var buildList = [
'check',
'clean:montyPython',
'post-clean',
];
var postCleanList = [];
grunt.registerTask('post-clean', 'post-clean', function() {
grunt.task.run(postCleanList);
});
function externalMultiTask(name, desc, command, updateOptions) {
grunt.log.writeln('registering multiTask', name);
......@@ -200,7 +190,6 @@ module.exports = function (grunt) {
generate: {
},
};
buildList.push('punch:generate');
htmlSourceDir = '.grunt/holygrail/punch/output-generate';
initConfig.copy.dist.files.push({
expand: true,
......@@ -428,42 +417,6 @@ module.exports = function (grunt) {
};
}
buildList.push('useminPrepare'); // html
//buildList.push('usemin:views'
if (mpConfig.bower) {
buildList.push('requirejs'); // script
}
buildList.push('copy:css'); // css
if (mpConfig.images) {
buildList.push('imagemin'); // image
buildList.push('svgmin'); // image
if (mpConfig.useRev) {
buildList.push('rev:img'); // image
}
}
//buildList.push('autoprefixer'); // css
buildList.push('concat:generated'); // montyPython
buildList.push('cssmin'); // montyPython
//'uglify:dist');
buildList.push('copy:dist');
//'modernizr');
//buildList.push('uglify:generated'); // montyPython
if (mpConfig.useRev) {
buildList.push('rev:dist'); // montyPython
buildList.push('rev:css'); // montyPython
buildList.push('revconfig'); // montyPython
}
if (mpConfig.bower) {
buildList.push('concat:requirejs'); // montyPython
}
if (mpConfig.useRev) {
buildList.push('rev:requirejs');
}
//buildList.push('uglify:bower'); // montyPython
//buildList.push('uglify:requireconfig'); // montyPython
buildList.push('usemin:html'); // montyPython
buildList.push('usemin:css'); // montyPython
buildList.push('htmlmin'); // montyPython
grunt.initConfig(initConfig);
......@@ -474,6 +427,10 @@ module.exports = function (grunt) {
]);
grunt.registerTask('build', 'build the system', function() {
var buildList = [
'check',
'clean:montyPython',
];
var featureFlags = {};
if (arguments.length) {
for (var i in arguments) {
......@@ -494,8 +451,48 @@ module.exports = function (grunt) {
}
grunt.file.write('.grunt/holygrail/scripts/featureFlags.js', lines.join('\n'));
});
postCleanList.add('writeFeatureFlags');
buildList.add('writeFeatureFlags');
}
if (mpConfig.punch) {
buildList.push('punch:generate');
}
buildList.push('useminPrepare'); // html
//buildList.push('usemin:views'
if (mpConfig.bower) {
buildList.push('requirejs'); // script
}
buildList.push('copy:css'); // css
if (mpConfig.images) {
buildList.push('imagemin'); // image
buildList.push('svgmin'); // image
if (mpConfig.useRev) {
buildList.push('rev:img'); // image
}
}
//buildList.push('autoprefixer'); // css
buildList.push('concat:generated'); // montyPython
buildList.push('cssmin'); // montyPython
//'uglify:dist');
buildList.push('copy:dist');
//'modernizr');
//buildList.push('uglify:generated'); // montyPython
if (mpConfig.useRev) {
buildList.push('rev:dist'); // montyPython
buildList.push('rev:css'); // montyPython
buildList.push('revconfig'); // montyPython
}
if (mpConfig.bower) {
buildList.push('concat:requirejs'); // montyPython
}
if (mpConfig.useRev) {
buildList.push('rev:requirejs');
}
//buildList.push('uglify:bower'); // montyPython
//buildList.push('uglify:requireconfig'); // montyPython
buildList.push('usemin:html'); // montyPython
buildList.push('usemin:css'); // montyPython
buildList.push('htmlmin'); // montyPython
grunt.task.run(buildList);
});
......