From 1e2c80849657030c90aaae5b8568611148227797 Mon Sep 17 00:00:00 2001 From: Daniel Rozenberg Date: Tue, 7 Sep 2021 12:32:41 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=20Parallelize=20`dist`=20steps=20(?= =?UTF-8?q?#35943)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-system/tasks/dist.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build-system/tasks/dist.js b/build-system/tasks/dist.js index bb5294b4b016..de528f13699c 100644 --- a/build-system/tasks/dist.js +++ b/build-system/tasks/dist.js @@ -113,17 +113,18 @@ async function dist() { await runPreDistSteps(options); // These steps use closure compiler. Small ones before large (parallel) ones. + const steps = []; if (argv.core_runtime_only) { - await compileCoreRuntime(options); + steps.push(compileCoreRuntime(options)); } else { - await buildExperiments(); - await buildLoginDone('0.1'); - await buildWebPushPublisherFiles(); - await compileAllJs(options); + steps.push(buildExperiments()); + steps.push(buildLoginDone('0.1')); + steps.push(buildWebPushPublisherFiles()); + steps.push(compileAllJs(options)); } // This step internally parses the various extension* flags. - await buildExtensions(options); + steps.push(buildExtensions(options)); // This step is to be run only during a full `amp dist`. if ( @@ -132,9 +133,11 @@ async function dist() { !argv.extensions_from && !argv.noextensions ) { - await buildVendorConfigs(options); + steps.push(buildVendorConfigs(options)); } + await Promise.all(steps); + // This step is required no matter which binaries are built. await formatExtractedMessages();