Files
jasmine/grunt/tasks/build_standalone.js
Dan Hansen and Davis W. Frank e09fd40933 Move to grunt for building all distribution files.
* canonical version number of jasmine-core is now is package.json
* `grunt buildDistribution` builds jasmine.js, jasmine-html.js, jasmine.css and outputs them to the dist dir
* `grunt buildStandaloneDist` builds the example spec runner files and compresses them to dist/jasmine-VERSION.zip
* `grunt compass` compiles jasmine.css
* jasmine.Env handling of version is backwards compatible, but uses the version string directly (and nicely deprecated)
* Ruby/thor tasks that did the above deleted
2013-03-03 16:04:38 -08:00

37 lines
1.0 KiB
JavaScript

var _ = require("underscore");
module.exports = function(grunt) {
return {
registerTasks: function() {
grunt.registerTask("build:compileSpecRunner",
"Processes the spec runner template and writes to a tmp file",
this.compileSpecRunner
);
grunt.registerTask("build:cleanSpecRunner",
"Deletes the tmp spec runner file",
this.cleanSpecRunner
);
grunt.registerTask("buildStandaloneDist",
"Builds a standalone distribution",
["build:compileSpecRunner", "compress:standalone", "build:cleanSpecRunner"]
);
},
compileSpecRunner: function() {
var runnerTemplate = _.template(grunt.file.read("lib/templates/SpecRunner.html.jst")),
runner = runnerTemplate({ jasmineVersion: global.jasmineVersion });
grunt.file.write(standaloneTmpDir("SpecRunner.html"), runner);
},
cleanSpecRunner: function() {
grunt.file.delete(standaloneTmpDir(""));
}
};
function standaloneTmpDir(path) {
return "dist/tmp/" + path;
}
};