diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2016-03-09 12:06:17 -0500 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2016-03-14 10:37:11 -0400 |
commit | 0f5f0c981aeedf56fa5b395029cc06b40c3ac2f1 (patch) | |
tree | 7ba229de65a7180ea6b893abfcab96b3af0370bf | |
parent | 728ea2f27720a351a014b698fd66d25075c0c5e3 (diff) | |
download | jquery-0f5f0c981aeedf56fa5b395029cc06b40c3ac2f1.tar.gz jquery-0f5f0c981aeedf56fa5b395029cc06b40c3ac2f1.zip |
Release: set version in source for releases
Fixes gh-2979
Close gh-2981
-rw-r--r-- | build/release.js | 14 | ||||
-rw-r--r-- | build/release/dist.js | 3 |
2 files changed, 16 insertions, 1 deletions
diff --git a/build/release.js b/build/release.js index a333d05b4..dd3745b35 100644 --- a/build/release.js +++ b/build/release.js @@ -1,3 +1,4 @@ +var fs = require( "fs" ); module.exports = function( Release ) { @@ -8,7 +9,8 @@ module.exports = function( Release ) { "dist/jquery.min.map", "dist/jquery.slim.js", "dist/jquery.slim.min.js", - "dist/jquery.slim.min.map" + "dist/jquery.slim.min.map", + "src/core.js" ], cdn = require( "./release/cdn" ), dist = require( "./release/dist" ), @@ -27,6 +29,15 @@ module.exports = function( Release ) { ensureSizzle( Release, callback ); }, /** + * Set the version in the src folder for distributing AMD + */ + _setSrcVersion: function() { + var corePath = __dirname + "/../src/core.js", + contents = fs.readFileSync( corePath, "utf8" ); + contents = contents.replace( /@VERSION/g, Release.newVersion ); + fs.writeFileSync( corePath, contents, "utf8" ); + }, + /** * Generates any release artifacts that should be included in the release. * The callback must be invoked with an array of files that should be * committed before creating the tag. @@ -40,6 +51,7 @@ module.exports = function( Release ) { "Grunt custom failed" ); cdn.makeReleaseCopies( Release ); + Release._setSrcVersion(); callback( files ); }, /** diff --git a/build/release/dist.js b/build/release/dist.js index 7c3c29a29..66cc6cde7 100644 --- a/build/release/dist.js +++ b/build/release/dist.js @@ -67,6 +67,9 @@ module.exports = function( Release, files, complete ) { shell.cp( "-rf", Release.dir.repo + "/" + file, Release.dir.dist ); } ); + // Remove the wrapper from the dist repo + shell.rm( "-f", Release.dir.dist + "/src/wrapper.js" ); + // Write generated bower file fs.writeFileSync( Release.dir.dist + "/bower.json", generateBower() ); |