From b4ddb5a953e23d194fa4682f686a62db4e30dd4d Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Mon, 11 Mar 2013 11:52:30 -0700 Subject: [PATCH 1/4] Improved build banners, including making them visible in minified version --- Gruntfile.js | 8 +++++++- src/openseadragon.js | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index c3006fbd..c762b250 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -60,7 +60,10 @@ module.exports = function(grunt) { }, concat: { options: { - banner: "/**\n * @version <%= pkg.name %> <%= pkg.version %>\n */\n\n" + banner: "//! <%= pkg.name %> <%= pkg.version %>\n" + + "//! Built on <%= grunt.template.today('yyyy-mm-dd') %>\n" + + "//! http://openseadragon.github.com\n\n", + process: true }, dist: { src: [ "" ].concat(sources), @@ -68,6 +71,9 @@ module.exports = function(grunt) { } }, uglify: { + options: { + preserveComments: "some" + }, openseadragon: { src: [ distribution ], dest: minified diff --git a/src/openseadragon.js b/src/openseadragon.js index 0335e593..b9c0b6dc 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -1,4 +1,6 @@ /** + * @version <%= pkg.name %> <%= pkg.version %> + * * @fileOverview *

* From 0756c4546af39f4aeabd0e57042720a71e669af5 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Tue, 12 Mar 2013 10:43:27 -0700 Subject: [PATCH 2/4] Grunt watch params were out of date; fixed --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index c762b250..6d4d837a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -113,7 +113,7 @@ module.exports = function(grunt) { } }, watch: { - files: [ "grunt.js", "src/*.js" ], + files: [ "Gruntfile.js", "src/*.js", "images/*" ], tasks: "build" }, jshint: { From b986b14407cb1fab8242c1dc1a3c97720cc255ac Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Tue, 12 Mar 2013 10:43:37 -0700 Subject: [PATCH 3/4] Minor wording change to readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d37c0cb1..aaac7786 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ For more information on the upgrade, see http://gruntjs.com/upgrading-from-0.3-t All command-line operations are scripted using [Grunt](http://gruntjs.com/) which is based on [Node.js](http://nodejs.org/). To get set up: -1. Install Node (available at the link above) -1. On the command line, run `npm install -g grunt-cli` (this will install the Grunt command line runner) +1. Install Node, if you haven't already (available at the link above) +1. Install the Grunt command line runner (if you haven't already); on the command line, run `npm install -g grunt-cli` 1. Clone the openseadragon repository 1. On the command line, go in to the openseadragon folder 1. Run `npm install` From e757aa2767df94cb6c3f9a390a71b00babbe2c09 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Tue, 12 Mar 2013 10:49:48 -0700 Subject: [PATCH 4/4] Added some section seperators to the grunt file --- Gruntfile.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index 6d4d837a..b043e067 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,6 @@ module.exports = function(grunt) { + // ---------- grunt.loadNpmTasks("grunt-contrib-compress"); grunt.loadNpmTasks("grunt-contrib-concat"); grunt.loadNpmTasks("grunt-contrib-jshint"); @@ -9,6 +10,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks("grunt-contrib-watch"); grunt.loadNpmTasks("grunt-contrib-clean"); + // ---------- var distribution = "build/openseadragon/openseadragon.js", minified = "build/openseadragon/openseadragon.min.js", sources = [ @@ -42,6 +44,7 @@ module.exports = function(grunt) { "src/viewport.js" ]; + // ---------- // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), @@ -130,6 +133,7 @@ module.exports = function(grunt) { } }); + // ---------- // Copy:build task. // Copies the image files into the appropriate location in the build folder. grunt.registerTask("copy:build", function() { @@ -138,6 +142,7 @@ module.exports = function(grunt) { }); }); + // ---------- // Copy:release task. // Copies the contents of the build folder into ../site-build. grunt.registerTask("copy:release", function() { @@ -150,24 +155,29 @@ 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" ]); + // ---------- // Test task. // Builds and runs unit tests. grunt.registerTask("test", ["build", "connect", "qunit"]); + // ---------- // Package task. // Builds and creates the .zip and .tar files. grunt.registerTask("package", ["build", "compress"]); + // ---------- // Publish task. // Cleans the built files out of ../site-build and copies newly built ones over. grunt.registerTask("publish", ["package", "clean:release", "copy:release"]); + // ---------- // Default task. // Does a normal build. grunt.registerTask("default", ["build"]);