Port the mozcentralbaseline target to Gulp

The baseline fix is dead code since three years, so we can safely remove
it.
This commit is contained in:
Tim van der Meij 2017-04-27 21:42:07 +02:00
parent 165294a05f
commit 74854fb4cc
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762
2 changed files with 26 additions and 33 deletions

View File

@ -43,6 +43,7 @@ var TEST_DIR = 'test/';
var EXTENSION_SRC_DIR = 'extensions/';
var BASELINE_DIR = BUILD_DIR + 'baseline/';
var MOZCENTRAL_BASELINE_DIR = BUILD_DIR + 'mozcentral.baseline/';
var GENERIC_DIR = BUILD_DIR + 'generic/';
var COMPONENTS_DIR = BUILD_DIR + 'components/';
var SINGLE_FILE_DIR = BUILD_DIR + 'singlefile/';
@ -1347,6 +1348,30 @@ gulp.task('dist-repo-git', ['dist-repo-prepare'], function () {
gulp.task('dist', ['dist-repo-git']);
gulp.task('mozcentralbaseline', ['baseline'], function (done) {
console.log();
console.log('### Creating mozcentral baseline environment');
// Create a mozcentral build.
rimraf.sync(BASELINE_DIR + BUILD_DIR);
spawnSync('gulp', ['mozcentral', '--cwd', BASELINE_DIR], {env: process.env});
// Copy the mozcentral build to the mozcentral baseline directory.
rimraf.sync(MOZCENTRAL_BASELINE_DIR);
mkdirp.sync(MOZCENTRAL_BASELINE_DIR);
gulp.src([BASELINE_DIR + BUILD_DIR + 'mozcentral/**/*'])
.pipe(gulp.dest(MOZCENTRAL_BASELINE_DIR))
.on('end', function () {
// Commit the mozcentral baseline.
spawnSync('git', ['init'], {cwd: MOZCENTRAL_BASELINE_DIR});
spawnSync('git', ['add', '.'], {cwd: MOZCENTRAL_BASELINE_DIR});
spawnSync('git', ['commit', '-m', 'mozcentral baseline'],
{cwd: MOZCENTRAL_BASELINE_DIR});
done();
});
});
// Getting all shelljs registered tasks and register them with gulp
require('./make.js');

34
make.js
View File

@ -223,39 +223,7 @@ target.baseline = function() {
};
target.mozcentralbaseline = function() {
target.baseline();
cd(ROOT_DIR);
echo();
echo('### Creating mozcentral baseline environment');
var BASELINE_DIR = BUILD_DIR + 'baseline';
var MOZCENTRAL_BASELINE_DIR = BUILD_DIR + 'mozcentral.baseline';
if (test('-d', MOZCENTRAL_BASELINE_DIR)) {
rm('-rf', MOZCENTRAL_BASELINE_DIR);
}
cd(BASELINE_DIR);
if (test('-d', 'build')) {
rm('-rf', 'build');
}
exec('node make mozcentral');
cd(ROOT_DIR);
mkdir(MOZCENTRAL_BASELINE_DIR);
cp('-Rf', BASELINE_DIR + '/build/mozcentral/*', MOZCENTRAL_BASELINE_DIR);
// fixing baseline
if (test('-f', MOZCENTRAL_BASELINE_DIR +
'/browser/extensions/pdfjs/PdfStreamConverter.js')) {
rm(MOZCENTRAL_BASELINE_DIR +
'/browser/extensions/pdfjs/PdfStreamConverter.js');
}
cd(MOZCENTRAL_BASELINE_DIR);
exec('git init');
exec('git add .');
exec('git commit -m "mozcentral baseline"');
execGulp('mozcentralbaseline');
};
target.mozcentraldiff = function() {