Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide logs from deleteAll on task: clean client modules into dll #26884

Merged
merged 5 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/dev/build/lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ export async function copy(source, destination) {
await chmodAsync(destination, stat.mode);
}

export async function deleteAll(log, patterns) {
export async function deleteAll(patterns, log = {}) {
if (!log.debug || !log.verbose) {
mistic marked this conversation as resolved.
Show resolved Hide resolved
log = {
debug: () => { /* NO-OP */},
verbose: () => { /* NO-OP */ }
};
}

if (!Array.isArray(patterns)) {
throw new TypeError('Expected patterns to be an array');
}
Expand Down
22 changes: 11 additions & 11 deletions src/dev/build/tasks/clean_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export const CleanTask = {
description: 'Cleaning artifacts from previous builds',

async run(config, log) {
await deleteAll(log, [
await deleteAll([
config.resolveFromRepo('build'),
config.resolveFromRepo('target'),
]);
], log);
},
};

Expand All @@ -38,11 +38,11 @@ export const CleanPackagesTask = {
'Cleaning source for packages that are now installed in node_modules',

async run(config, log, build) {
await deleteAll(log, [
await deleteAll([
build.resolvePath('packages'),
build.resolvePath('x-pack'),
build.resolvePath('yarn.lock'),
]);
], log);
},
};

Expand Down Expand Up @@ -176,14 +176,14 @@ export const CleanExtraBinScriptsTask = {
async run(config, log, build) {
for (const platform of config.getNodePlatforms()) {
if (platform.isWindows()) {
await deleteAll(log, [
await deleteAll([
build.resolvePathForPlatform(platform, 'bin', '*'),
`!${build.resolvePathForPlatform(platform, 'bin', '*.bat')}`,
]);
], log);
} else {
await deleteAll(log, [
await deleteAll([
build.resolvePathForPlatform(platform, 'bin', '*.bat'),
]);
], log);
}
}
},
Expand Down Expand Up @@ -224,11 +224,11 @@ export const CleanExtraBrowsersTask = {
for (const platform of config.getNodePlatforms()) {
const getBrowserPaths = getBrowserPathsForPlatform(platform);
if (platform.isWindows()) {
await deleteAll(log, getBrowserPaths({ linux: true, darwin: true }));
await deleteAll(getBrowserPaths({ linux: true, darwin: true }), log);
} else if (platform.isMac()) {
await deleteAll(log, getBrowserPaths({ linux: true, windows: true }));
await deleteAll(getBrowserPaths({ linux: true, windows: true }), log);
} else if (platform.isLinux()) {
await deleteAll(log, getBrowserPaths({ windows: true, darwin: true }));
await deleteAll(getBrowserPaths({ windows: true, darwin: true }), log);
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/dev/build/tasks/nodejs/clean_node_builds_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ export const CleanNodeBuildsTask = {

async run(config, log, build) {
for (const platform of config.getNodePlatforms()) {
await deleteAll(log, [
await deleteAll([
build.resolvePathForPlatform(platform, 'node/lib/node_modules'),
build.resolvePathForPlatform(platform, 'node/bin/npm'),
build.resolvePathForPlatform(platform, 'node/bin/npx'),
]);
], log);
}
},
};
2 changes: 1 addition & 1 deletion src/dev/build/tasks/nodejs_modules/webpack_dll.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function cleanDllModuleFromEntryPath(logger, entryPath) {
`!${moduleDir}/**/*.+(gif|ico|jpeg|jpg|tiff|tif|svg|png|webp)`,
`!${modulePkgPath}`,
]);
await deleteAll(logger, deletePatterns);
await deleteAll(deletePatterns);

// Mark this module as cleaned
modulePkg.cleaned = true;
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/optimize_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ export const OptimizeBuildTask = {
});

// clean up temporary node install
await deleteAll(log, [tempNodeInstallDir]);
await deleteAll([tempNodeInstallDir], log);
},
};