2016-03-09 17:06:17 +00:00
|
|
|
var fs = require( "fs" );
|
2015-01-28 19:37:29 +00:00
|
|
|
|
2013-12-20 22:13:48 +00:00
|
|
|
module.exports = function( Release ) {
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2013-12-20 22:13:48 +00:00
|
|
|
var
|
2015-11-12 18:18:59 +00:00
|
|
|
files = [
|
|
|
|
"dist/jquery.js",
|
|
|
|
"dist/jquery.min.js",
|
|
|
|
"dist/jquery.min.map",
|
|
|
|
"dist/jquery.slim.js",
|
|
|
|
"dist/jquery.slim.min.js",
|
2016-03-09 17:06:17 +00:00
|
|
|
"dist/jquery.slim.min.map",
|
|
|
|
"src/core.js"
|
2015-11-12 18:18:59 +00:00
|
|
|
],
|
2015-01-28 19:37:29 +00:00
|
|
|
cdn = require( "./release/cdn" ),
|
|
|
|
dist = require( "./release/dist" ),
|
|
|
|
ensureSizzle = require( "./release/ensure-sizzle" ),
|
2013-12-20 22:13:48 +00:00
|
|
|
|
2015-01-28 19:37:29 +00:00
|
|
|
npmTags = Release.npmTags;
|
2013-12-20 22:13:48 +00:00
|
|
|
|
2015-08-16 06:59:58 +00:00
|
|
|
Release.define( {
|
2014-01-10 12:45:01 +00:00
|
|
|
npmPublish: true,
|
2015-01-28 19:37:29 +00:00
|
|
|
issueTracker: "github",
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2014-05-23 16:45:51 +00:00
|
|
|
/**
|
|
|
|
* Ensure the repo is in a proper state before release
|
|
|
|
* @param {Function} callback
|
|
|
|
*/
|
|
|
|
checkRepoState: function( callback ) {
|
|
|
|
ensureSizzle( Release, callback );
|
|
|
|
},
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2016-03-09 17:06:17 +00:00
|
|
|
/**
|
|
|
|
* 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" );
|
|
|
|
},
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2013-12-20 22:13:48 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
* @param {Function} callback
|
|
|
|
*/
|
|
|
|
generateArtifacts: function( callback ) {
|
2014-03-18 15:48:21 +00:00
|
|
|
Release.exec( "grunt", "Grunt command failed" );
|
2015-11-12 18:18:59 +00:00
|
|
|
Release.exec(
|
2017-02-06 16:50:15 +00:00
|
|
|
"grunt custom:-ajax,-effects --filename=jquery.slim.js && " +
|
2015-11-12 18:18:59 +00:00
|
|
|
"grunt remove_map_comment --filename=jquery.slim.js",
|
|
|
|
"Grunt custom failed"
|
|
|
|
);
|
2015-01-28 19:37:29 +00:00
|
|
|
cdn.makeReleaseCopies( Release );
|
2016-03-09 17:06:17 +00:00
|
|
|
Release._setSrcVersion();
|
2015-01-28 19:37:29 +00:00
|
|
|
callback( files );
|
2013-12-20 22:13:48 +00:00
|
|
|
},
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2013-12-20 22:13:48 +00:00
|
|
|
/**
|
2015-01-28 19:37:29 +00:00
|
|
|
* Acts as insertion point for restoring Release.dir.repo
|
|
|
|
* It was changed to reuse npm publish code in jquery-release
|
|
|
|
* for publishing the distribution repo instead
|
2013-12-20 22:13:48 +00:00
|
|
|
*/
|
2015-01-28 19:37:29 +00:00
|
|
|
npmTags: function() {
|
2015-08-16 06:59:58 +00:00
|
|
|
|
2015-01-28 19:37:29 +00:00
|
|
|
// origRepo is not defined if dist was skipped
|
|
|
|
Release.dir.repo = Release.dir.origRepo || Release.dir.repo;
|
|
|
|
return npmTags();
|
2013-12-20 22:13:48 +00:00
|
|
|
},
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2013-12-20 22:13:48 +00:00
|
|
|
/**
|
2015-01-28 19:37:29 +00:00
|
|
|
* Publish to distribution repo and npm
|
|
|
|
* @param {Function} callback
|
2013-12-20 22:13:48 +00:00
|
|
|
*/
|
2015-01-28 19:37:29 +00:00
|
|
|
dist: function( callback ) {
|
2015-01-30 00:21:39 +00:00
|
|
|
cdn.makeArchives( Release, function() {
|
2015-11-12 18:18:59 +00:00
|
|
|
dist( Release, files, callback );
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|
2013-12-20 22:13:48 +00:00
|
|
|
}
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|
2013-12-20 22:13:48 +00:00
|
|
|
};
|
2014-03-18 15:48:21 +00:00
|
|
|
|
|
|
|
module.exports.dependencies = [
|
2017-03-15 18:57:20 +00:00
|
|
|
"archiver@1.3.0",
|
|
|
|
"shelljs@0.7.7",
|
|
|
|
"npm@4.4.1",
|
|
|
|
"chalk@1.1.3"
|
2014-03-18 15:48:21 +00:00
|
|
|
];
|