First attempt

This commit is contained in:
Ian Gilman 2013-03-21 10:26:03 -07:00
parent 65bb177fb8
commit 2bc61933b2
2 changed files with 10 additions and 2 deletions

View File

@ -9,6 +9,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-git-describe");
// ----------
var distribution = "build/openseadragon/openseadragon.js",
@ -65,6 +66,7 @@ module.exports = function(grunt) {
options: {
banner: "//! <%= pkg.name %> <%= pkg.version %>\n"
+ "//! Built on <%= grunt.template.today('yyyy-mm-dd') %>\n"
+ "//! <%= grunt.config.get('describeResult') %>\n"
+ "//! http://openseadragon.github.com\n\n",
process: true
},
@ -130,6 +132,11 @@ module.exports = function(grunt) {
},
beforeconcat: sources,
afterconcat: [ distribution ]
},
"git-describe": {
options: {
prop: "describeResult"
}
}
});
@ -159,7 +166,7 @@ module.exports = function(grunt) {
// Build task.
// Cleans out the build folder and builds the code and images into it, checking lint.
grunt.registerTask("build", [
"clean:build", "jshint:beforeconcat", "concat", "jshint:afterconcat", "uglify", "copy:build"
"clean:build", "jshint:beforeconcat", "git-describe", "concat", "jshint:afterconcat", "uglify", "copy:build"
]);
// ----------

View File

@ -11,7 +11,8 @@
"grunt-contrib-qunit": "~0.1.1",
"grunt-contrib-connect": "~0.1.2",
"grunt-contrib-watch": "~0.2.0",
"grunt-contrib-clean": "~0.4.0"
"grunt-contrib-clean": "~0.4.0",
"grunt-git-describe": "~2.0.0"
},
"scripts": {
"test": "grunt test"