diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-11-02 16:41:25 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-12-02 17:30:37 +0100 |
commit | 6c738d961d9918f75a3043a49ab21ac79bca45ae (patch) | |
tree | ccafec877c13d3201a36f01b0c713e52e41282bf /build/release.js | |
parent | 3fb25df9206ef1538f321b4ced122c6e4c107233 (diff) | |
download | jquery-ui-6c738d961d9918f75a3043a49ab21ac79bca45ae.tar.gz jquery-ui-6c738d961d9918f75a3043a49ab21ac79bca45ae.zip |
Release: Update for 1.12 release, add test script
Fixes jquery/download.jqueryui.com#282
Diffstat (limited to 'build/release.js')
-rw-r--r-- | build/release.js | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/build/release.js b/build/release.js index bebb89fec..b868cbebd 100644 --- a/build/release.js +++ b/build/release.js @@ -1,5 +1,6 @@ module.exports = function( Release ) { +var crypto = require( "crypto" ); var shell = require( "shelljs" ), path = require( "path" ), fs = require( "fs" ); @@ -34,23 +35,41 @@ function replaceAtVersion() { return matches; } +function addManifest( packager ) { + var output = packager.builtFiles; + output.MANIFEST = Object.keys( output ).sort( function( a, b ) { + return a.localeCompare( b ); + } ).map( function( filepath ) { + var md5 = crypto.createHash( "md5" ); + md5.update( output[ filepath ] ); + return filepath + " " + md5.digest( "hex" ); + } ).join( "\n" ); +} + function buildCDNPackage( callback ) { console.log( "Building CDN package" ); - var downloadBuilder = require( "download.jqueryui.com" ), - jqueryUi = new downloadBuilder.JqueryUi( path.resolve( "." ) ), - builder = new downloadBuilder.Builder( jqueryUi, ":all:" ), - packer = new downloadBuilder.ThemesPacker( builder, { - includeJs: true + var JqueryUi = require( "download.jqueryui.com/lib/jquery-ui" ); + var Package = require( "download.jqueryui.com/lib/package-1-12-themes" ); + var Packager = require( "node-packager" ); + var jqueryUi = new JqueryUi( path.resolve( "." ) ); + var target = fs.createWriteStream( "../" + jqueryUi.pkg.name + "-" + jqueryUi.pkg.version + "-cdn.zip" ); + var packager = new Packager( jqueryUi.files().cache, Package, { + components: jqueryUi.components().map( function( component ) { + return component.name; } ), - target = "../" + jqueryUi.pkg.name + "-" + jqueryUi.pkg.version + "-cdn.zip"; - - // Zip dir structure must be flat, override default base folder - packer.basedir = ""; - packer.zipTo( target, function( error ) { - if ( error ) { - Release.abort( "Failed to zip CDN package", error ); - } - callback(); + jqueryUi: jqueryUi, + themeVars: null + } ); + packager.ready.then( function() { + addManifest( packager ); + packager.toZip( target, { + basedir: "" + }, function( error ) { + if ( error ) { + Release.abort( "Failed to zip CDN package", error ); + } + callback(); + } ); } ); } @@ -91,6 +110,7 @@ Release.define( { }; module.exports.dependencies = [ - "download.jqueryui.com@2.1.1", + "download.jqueryui.com@2.1.2", + "node-packager@0.0.6", "shelljs@0.2.6" ]; |