From afba82222e532f560ff14af8f258410ecc982c66 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Fri, 29 May 2020 11:17:16 -0700 Subject: [PATCH] Fix recompile script (#3926) --- gulpfile.js | 3 ++- package.json | 2 +- scripts/gulpfiles/git_tasks.js | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 2f581115e..6c3e840c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -29,7 +29,8 @@ module.exports = { gitSyncDevelop: gitTasks.syncDevelop, gitSyncMaster: gitTasks.syncMaster, gitCreateRC: gitTasks.createRC, - gitRecompile: gitTasks.recompile, + gitPreCompile: gitTasks.preCompile, + gitPostCompile: gitTasks.postCompile, gitUpdateGithubPages: gitTasks.updateGithubPages, typings: gulp.series(typings.typings, typings.msgTypings), package: packageTasks.package, diff --git a/package.json b/package.json index 0b75c372b..62a4680db 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "lint": "eslint .", "package": "gulp package", "prepare": "npm run package", - "recompile": "gulp gitRecompile", + "recompile": "gulp gitPreCompile && npm run bump && gulp gitPostCompile", "release": "gulp gitCreateRC", "test": "concurrently 'npm run test:prepare' 'sleep 5 && npm run test:run'", "test:prepare": "npm run test:setupselenium && npm run test:startselenium", diff --git a/scripts/gulpfiles/git_tasks.js b/scripts/gulpfiles/git_tasks.js index 29feb1274..ba9c50519 100644 --- a/scripts/gulpfiles/git_tasks.js +++ b/scripts/gulpfiles/git_tasks.js @@ -10,7 +10,6 @@ var gulp = require('gulp'); var execSync = require('child_process').execSync; -var exec = require('child_process').exec; var typings = require('./typings'); var buildTasks = require('./build_tasks'); @@ -64,19 +63,19 @@ function checkoutBranch(branchName) { { stdio: 'inherit' }); } -// Recompile and push to origin. -const recompile = gulp.series( +// Switch to a new rebuild branch. +const preCompile = gulp.series( syncDevelop(), function(done) { var branchName = getRebuildBranchName(); console.log('make-rebuild-branch: creating branch ' + branchName); execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); done(); - }, - function(done) { - exec('npm run bump'); - done(); - }, + } +); + +// Build all files, types, and push to rebuild branch. +const postCompile = gulp.series( buildTasks.build, typings.typings, function(done) { @@ -87,7 +86,7 @@ const recompile = gulp.series( console.log('Branch ' + branchName + ' pushed to GitHub.'); console.log('Next step: create a pull request against develop.'); done(); - } + } ); // Create and push an RC branch. @@ -119,6 +118,7 @@ module.exports = { syncDevelop: syncDevelop, syncMaster: syncMaster, createRC: createRC, - recompile: recompile, + preCompile: preCompile, + postCompile: postCompile, updateGithubPages: updateGithubPages }