Merge pull request #7256 from timvandermeij/gulp-targets
Port the `publish` target to Gulp
This commit is contained in:
commit
4dc00b003d
22
gulpfile.js
22
gulpfile.js
@ -24,6 +24,7 @@ var rimraf = require('rimraf');
|
|||||||
var stream = require('stream');
|
var stream = require('stream');
|
||||||
var exec = require('child_process').exec;
|
var exec = require('child_process').exec;
|
||||||
var streamqueue = require('streamqueue');
|
var streamqueue = require('streamqueue');
|
||||||
|
var zip = require('gulp-zip');
|
||||||
|
|
||||||
var BUILD_DIR = 'build/';
|
var BUILD_DIR = 'build/';
|
||||||
var L10N_DIR = 'l10n/';
|
var L10N_DIR = 'l10n/';
|
||||||
@ -337,6 +338,27 @@ gulp.task('bundle', ['buildnumber'], function () {
|
|||||||
return createBundle(DEFINES).pipe(gulp.dest(BUILD_DIR));
|
return createBundle(DEFINES).pipe(gulp.dest(BUILD_DIR));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('publish', ['generic'], function (done) {
|
||||||
|
var version = JSON.parse(
|
||||||
|
fs.readFileSync(BUILD_DIR + 'version.json').toString()).version;
|
||||||
|
|
||||||
|
config.stableVersion = config.betaVersion;
|
||||||
|
config.betaVersion = version;
|
||||||
|
|
||||||
|
createStringSource(CONFIG_FILE, JSON.stringify(config, null, 2))
|
||||||
|
.pipe(gulp.dest('.'))
|
||||||
|
.on('end', function () {
|
||||||
|
var targetName = 'pdfjs-' + version + '-dist.zip';
|
||||||
|
gulp.src(BUILD_DIR + 'generic/**')
|
||||||
|
.pipe(zip(targetName))
|
||||||
|
.pipe(gulp.dest(BUILD_DIR))
|
||||||
|
.on('end', function () {
|
||||||
|
console.log('Built distribution file: ' + targetName);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('server', function (done) {
|
gulp.task('server', function (done) {
|
||||||
console.log();
|
console.log();
|
||||||
console.log('### Starting local server');
|
console.log('### Starting local server');
|
||||||
|
11
make.js
11
make.js
@ -385,16 +385,7 @@ target.dist = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
target.publish = function() {
|
target.publish = function() {
|
||||||
target.generic();
|
exec('gulp publish');
|
||||||
var VERSION = getCurrentVersion();
|
|
||||||
config.stableVersion = config.betaVersion;
|
|
||||||
config.betaVersion = VERSION;
|
|
||||||
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
||||||
cd(GENERIC_DIR);
|
|
||||||
var distFilename = 'pdfjs-' + VERSION + '-dist.zip';
|
|
||||||
exec('zip -r ' + ROOT_DIR + BUILD_DIR + distFilename + ' *');
|
|
||||||
echo('Built distribution file: ' + distFilename);
|
|
||||||
cd(ROOT_DIR);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-util": "^3.0.7",
|
"gulp-util": "^3.0.7",
|
||||||
|
"gulp-zip": "^3.2.0",
|
||||||
"jasmine-core": "^2.4.1",
|
"jasmine-core": "^2.4.1",
|
||||||
"jsdoc": "^3.3.0-alpha9",
|
"jsdoc": "^3.3.0-alpha9",
|
||||||
"jshint": "~2.8.0",
|
"jshint": "~2.8.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user