Skip to content

Commit

Permalink
report oss and default distributable sizes in separate groups
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed May 6, 2020
1 parent a9e83b7 commit 5e122d2
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/dev/build/tasks/create_archives_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const CreateArchivesTask = {
description: 'Creating the archives for each platform',

async run(config, log, build) {
const files = [];
const archives = [];

// archive one at a time, parallel causes OOM sometimes
for (const platform of config.getTargetPlatforms()) {
Expand All @@ -41,10 +41,14 @@ export const CreateArchivesTask = {
log.info('archiving', source, 'to', destination);

await mkdirp(Path.dirname(destination));
files.push(destination);

switch (Path.extname(destination)) {
case '.zip':
archives.push({
format: 'zip',
path: destination,
});

await compress(
'zip',
{
Expand All @@ -61,6 +65,11 @@ export const CreateArchivesTask = {
break;

case '.gz':
archives.push({
format: 'tar',
path: destination,
});

await compress(
'tar',
{
Expand All @@ -86,10 +95,10 @@ export const CreateArchivesTask = {
if (reporter.isEnabled()) {
await reporter.metrics(
await Promise.all(
files.map(async path => {
archives.map(async ({ format, path }) => {
return {
group: 'distributable size',
id: Path.basename(path),
group: `${build.isOss() ? 'oss ' : ''}distributable size`,
id: format,
value: (await asyncStat(path)).size,
};
})
Expand Down

0 comments on commit 5e122d2

Please sign in to comment.