From 6d83327a86d8540b3ef914389f7c6695413e3e3e Mon Sep 17 00:00:00 2001 From: Hao Nguyen Date: Wed, 1 May 2019 13:22:07 -0700 Subject: [PATCH] Fix gulpfile to use gulp 4 API --- js/gulpfile.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/js/gulpfile.js b/js/gulpfile.js index b2366995e8..449ae502c2 100644 --- a/js/gulpfile.js +++ b/js/gulpfile.js @@ -144,7 +144,7 @@ function getClosureBuilderCommand(exportsFile, outputFile) { exportsFile + ' > ' + outputFile; } -gulp.task('dist', ['genproto_wellknowntypes'], function (cb) { +gulp.task('dist', gulp.series(['genproto_wellknowntypes'], function (cb) { // TODO(haberman): minify this more aggressively. // Will require proper externs/exports. exec(getClosureBuilderCommand('commonjs/export.js', 'google-protobuf.js'), @@ -153,7 +153,7 @@ gulp.task('dist', ['genproto_wellknowntypes'], function (cb) { console.log(stderr); cb(err); }); -}); +})); gulp.task('commonjs_asserts', function (cb) { exec('mkdir -p commonjs_out/test_node_modules && ' + @@ -179,7 +179,7 @@ gulp.task('commonjs_testdeps', function (cb) { }); }); -gulp.task('make_commonjs_out', ['dist', 'genproto_well_known_types_commonjs', 'genproto_group1_commonjs', 'genproto_group2_commonjs', 'genproto_commonjs_wellknowntypes', 'commonjs_asserts', 'commonjs_testdeps', 'genproto_group3_commonjs_strict'], function (cb) { +gulp.task('make_commonjs_out', gulp.series(['dist', 'genproto_well_known_types_commonjs', 'genproto_group1_commonjs', 'genproto_group2_commonjs', 'genproto_commonjs_wellknowntypes', 'commonjs_asserts', 'commonjs_testdeps', 'genproto_group3_commonjs_strict'], function (cb) { // TODO(haberman): minify this more aggressively. // Will require proper externs/exports. var cmd = "mkdir -p commonjs_out/binary && mkdir -p commonjs_out/test_node_modules && "; @@ -201,35 +201,35 @@ gulp.task('make_commonjs_out', ['dist', 'genproto_well_known_types_commonjs', 'g console.log(stderr); cb(err); }); -}); +})); -gulp.task('deps', ['genproto_well_known_types_closure', 'genproto_group1_closure', 'genproto_group2_closure'], function (cb) { +gulp.task('deps', gulp.series(['genproto_well_known_types_closure', 'genproto_group1_closure', 'genproto_group2_closure'], function (cb) { exec('./node_modules/google-closure-library/closure/bin/build/depswriter.py binary/arith.js binary/constants.js binary/decoder.js binary/encoder.js binary/reader.js binary/utils.js binary/writer.js debug.js map.js message.js node_loader.js test_bootstrap.js > deps.js', function (err, stdout, stderr) { console.log(stdout); console.log(stderr); cb(err); }); -}); +})); -gulp.task('test_closure', ['genproto_well_known_types_closure', 'genproto_group1_closure', 'genproto_group2_closure', 'deps'], function (cb) { +gulp.task('test_closure', gulp.series(['genproto_well_known_types_closure', 'genproto_group1_closure', 'genproto_group2_closure', 'deps'], function (cb) { exec('JASMINE_CONFIG_PATH=jasmine.json ./node_modules/.bin/jasmine', function (err, stdout, stderr) { console.log(stdout); console.log(stderr); cb(err); }); -}); +})); -gulp.task('test_commonjs', ['make_commonjs_out'], function (cb) { +gulp.task('test_commonjs', gulp.series(['make_commonjs_out'], function (cb) { exec('cd commonjs_out && JASMINE_CONFIG_PATH=jasmine.json NODE_PATH=test_node_modules ../node_modules/.bin/jasmine', function (err, stdout, stderr) { console.log(stdout); console.log(stderr); cb(err); }); -}); +})); -gulp.task('test', ['test_closure', 'test_commonjs'], function(cb) { +gulp.task('test', gulp.series(['test_closure', 'test_commonjs'], function(cb) { cb(); -}); +}));