Skip to content

Commit

Permalink
Build/grunt: Update to latest grunt API, using reigsterMultiTask inst…
Browse files Browse the repository at this point in the history
…ead of registerBasicTask
  • Loading branch information
jzaefferer committed Mar 19, 2012
1 parent b1167ef commit 5f95e7c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions grunt.js
Expand Up @@ -281,7 +281,7 @@ config.init({
} }
}); });


task.registerBasicTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() { task.registerMultiTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() {
function replaceVersion( source ) { function replaceVersion( source ) {
return source.replace( "@VERSION", config( "pkg.version" ) ); return source.replace( "@VERSION", config( "pkg.version" ) );
} }
Expand All @@ -307,7 +307,7 @@ task.registerBasicTask( "copy", "Copy files to destination folder and replace @V
}); });




task.registerBasicTask( "zip", "Create a zip file for release", function() { task.registerMultiTask( "zip", "Create a zip file for release", function() {
var done = this.async(); var done = this.async();
// TODO switch back to adm-zip for better cross-platform compability once it actually works // TODO switch back to adm-zip for better cross-platform compability once it actually works
// 0.1.2 doesn't compress properly (or at all) // 0.1.2 doesn't compress properly (or at all)
Expand Down Expand Up @@ -345,7 +345,7 @@ task.registerBasicTask( "zip", "Create a zip file for release", function() {
}); });
}); });


task.registerBasicTask( "csslint", "Lint CSS files with csslint", function() { task.registerMultiTask( "csslint", "Lint CSS files with csslint", function() {
var csslint = require( "csslint" ).CSSLint; var csslint = require( "csslint" ).CSSLint;
var files = file.expand( this.file.src ); var files = file.expand( this.file.src );
var ruleset = {}; var ruleset = {};
Expand Down Expand Up @@ -377,15 +377,15 @@ task.registerBasicTask( "csslint", "Lint CSS files with csslint", function() {
log.writeln( "Lint free" ); log.writeln( "Lint free" );
}); });


task.registerBasicTask( "css_min", "Minify CSS files with Sqwish.", function() { task.registerMultiTask( "css_min", "Minify CSS files with Sqwish.", function() {
var max = task.helper( "concat", file.expand( this.file.src ) ); var max = task.helper( "concat", file.expand( this.file.src ) );
var min = require( "sqwish" ).minify( max, false ); var min = require( "sqwish" ).minify( max, false );
file.write( this.file.dest, min ); file.write( this.file.dest, min );
log.writeln( "File '" + this.file.dest + "' created." ); log.writeln( "File '" + this.file.dest + "' created." );
task.helper( "min_max_info", min, max ); task.helper( "min_max_info", min, max );
}); });


task.registerBasicTask( "md5", "Create list of md5 hashes for CDN uploads", function() { task.registerMultiTask( "md5", "Create list of md5 hashes for CDN uploads", function() {
// remove dest file before creating it, to make sure itself is not included // remove dest file before creating it, to make sure itself is not included
if ( require( "path" ).existsSync( this.file.dest ) ) { if ( require( "path" ).existsSync( this.file.dest ) ) {
require( "fs" ).unlinkSync( this.file.dest ); require( "fs" ).unlinkSync( this.file.dest );
Expand Down Expand Up @@ -462,7 +462,7 @@ task.registerTask( "copy_themes", function() {
// TODO merge with code in jQuery Core, share as grunt plugin/npm // TODO merge with code in jQuery Core, share as grunt plugin/npm
// this here actually uses the provided filenames in the output // this here actually uses the provided filenames in the output
// the helpers should just be regular functions, no need to share those with the world // the helpers should just be regular functions, no need to share those with the world
task.registerBasicTask( "compare_size", "Compare size of this branch to master", function() { task.registerMultiTask( "compare_size", "Compare size of this branch to master", function() {
var files = file.expand( this.file.src ), var files = file.expand( this.file.src ),
done = this.async(), done = this.async(),
sizecache = __dirname + "/dist/.sizecache.json", sizecache = __dirname + "/dist/.sizecache.json",
Expand Down

0 comments on commit 5f95e7c

Please sign in to comment.