aboutsummaryrefslogtreecommitdiffstats
path: root/build/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'build/tasks')
-rw-r--r--build/tasks/build.js82
1 files changed, 1 insertions, 81 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js
index ca36ff998..4d803df77 100644
--- a/build/tasks/build.js
+++ b/build/tasks/build.js
@@ -2,8 +2,7 @@ module.exports = function( grunt ) {
"use strict";
-var path = require( "path" ),
- fs = require( "fs" );
+var fs = require( "fs" );
function expandFiles( files ) {
return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).filter(function(filepath) {
@@ -132,85 +131,6 @@ grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @
}
});
-
-grunt.registerMultiTask( "zip", "Create a zip file for release", function() {
- var done = this.async(),
- dest = this.data.dest;
- grunt.util.spawn({
- cmd: "zip",
- args: [ "-r", dest, this.data.src ],
- opts: {
- cwd: "dist"
- }
- }, function( err ) {
- if ( err ) {
- grunt.log.error( err );
- done();
- return;
- }
- grunt.log.writeln( "Zipped " + dest );
- done();
- });
-});
-
-grunt.registerMultiTask( "md5", "Create list of md5 hashes for CDN uploads", function() {
- // remove dest file before creating it, to make sure itself is not included
- if ( fs.existsSync( this.data.dest ) ) {
- fs.unlinkSync( this.data.dest );
- }
- var crypto = require( "crypto" ),
- dir = this.filesSrc + "/",
- hashes = [];
- expandFiles( dir + "**/*" ).forEach(function( fileName ) {
- var hash = crypto.createHash( "md5" );
- hash.update( grunt.file.read( fileName, "ascii" ) );
- hashes.push( fileName.replace( dir, "" ) + " " + hash.digest( "hex" ) );
- });
- grunt.file.write( this.data.dest, hashes.join( "\n" ) + "\n" );
- grunt.log.writeln( "Wrote " + this.data.dest + " with " + hashes.length + " hashes" );
-});
-
-grunt.registerTask( "generate_themes", function() {
- var download, done,
- distFolder = "dist/" + grunt.template.process( grunt.config( "files.dist" ), grunt.config() ),
- target = "dist/" + grunt.template.process( grunt.config( "files.themes" ), grunt.config() ) + "/";
-
- try {
- require.resolve( "download.jqueryui.com" );
- } catch( error ) {
- throw new Error( "You need to manually install download.jqueryui.com for this task to work" );
- }
-
- download = require( "download.jqueryui.com" )({
- config: {
- "jqueryUi": {
- "stable": { "path": path.resolve( __dirname + "/../../" + distFolder ) }
- },
- "jquery": "skip"
- }
- });
-
- done = this.async();
- download.buildThemesBundle(function( error, files ) {
- if ( error ) {
- grunt.log.error( error );
- return done( false );
- }
-
- done(
- files.every(function( file ) {
- try {
- grunt.file.write( target + file.path, file.data );
- } catch( err ) {
- grunt.log.error( err );
- return false;
- }
- return true;
- }) && grunt.log.writeln( "Generated at " + target )
- );
- });
-});
-
grunt.registerTask( "clean", function() {
require( "rimraf" ).sync( "dist" );
});