[Finishes #52810607] separate out the build standalone tasks

This commit is contained in:
Greg Cobb and JR Boyens
2013-07-18 09:51:27 -07:00
parent 0daae4d7b4
commit 82b6904093
3 changed files with 29 additions and 31 deletions

View File

@@ -1,17 +1,30 @@
var grunt = require("grunt");
function standaloneTmpDir(path) { return "dist/tmp/" + path; }
grunt.registerTask("build:compileSpecRunner",
"Processes the spec runner template and writes to a tmp file",
function() {
var runnerHtml = grunt.template.process(
grunt.file.read("grunt/templates/SpecRunner.html.jst"),
{ data: { jasmineVersion: global.jasmineVersion }});
module.exports = {
compileSpecRunner: function() {
var runnerHtml = grunt.template.process(
grunt.file.read("grunt/templates/SpecRunner.html.jst"),
{ data: { jasmineVersion: global.jasmineVersion }});
grunt.file.write(standaloneTmpDir("SpecRunner.html"), runnerHtml);
}
);
grunt.file.write(standaloneTmpDir("SpecRunner.html"), runnerHtml);
},
grunt.registerTask("build:cleanSpecRunner",
"Deletes the tmp spec runner file",
function() {
grunt.file.delete(standaloneTmpDir(""));
}
);
cleanSpecRunner: function() {
grunt.file.delete(standaloneTmpDir(""));
}
};
grunt.registerTask("buildStandaloneDist",
"Builds a standalone distribution",
[
"build:compileSpecRunner",
"compress:standalone",
"build:cleanSpecRunner"
]
);