mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[build] Clean extra browsers (#19629)
This commit is contained in:
parent
99d76fd735
commit
1df4946670
2 changed files with 45 additions and 0 deletions
|
@ -23,6 +23,7 @@ import {
|
|||
BootstrapTask,
|
||||
BuildPackagesTask,
|
||||
CleanExtraBinScriptsTask,
|
||||
CleanExtraBrowsersTask,
|
||||
CleanExtraFilesFromModulesTask,
|
||||
CleanPackagesTask,
|
||||
CleanTypescriptTask,
|
||||
|
@ -116,6 +117,7 @@ export async function buildDistributables(options) {
|
|||
*/
|
||||
await run(CreateArchivesSourcesTask);
|
||||
await run(CleanExtraBinScriptsTask);
|
||||
await run(CleanExtraBrowsersTask);
|
||||
|
||||
/**
|
||||
* package platform-specific builds into archives
|
||||
|
|
|
@ -84,3 +84,46 @@ export const CleanExtraBinScriptsTask = {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const CleanExtraBrowsersTask = {
|
||||
description: 'Cleaning extra browsers from platform-specific builds',
|
||||
|
||||
async run(config, log, build) {
|
||||
const getBrowserPathsForPlatform = (platform) => {
|
||||
const reportingDir = 'node_modules/x-pack/plugins/reporting';
|
||||
const phantomDir = '.phantom';
|
||||
const chromiumDir = '.chromium';
|
||||
const phantomPath = p => build.resolvePathForPlatform(platform, reportingDir, phantomDir, p);
|
||||
const chromiumPath = p => build.resolvePathForPlatform(platform, reportingDir, chromiumDir, p);
|
||||
return platforms => {
|
||||
const paths = [];
|
||||
if (platforms.windows) {
|
||||
paths.push(phantomPath('phantomjs-*-windows.zip'));
|
||||
paths.push(chromiumPath('chromium-*-win32.zip'));
|
||||
}
|
||||
|
||||
if (platforms.darwin) {
|
||||
paths.push(phantomPath('phantomjs-*-macosx.zip'));
|
||||
paths.push(chromiumPath('chromium-*-darwin.zip'));
|
||||
}
|
||||
|
||||
if (platforms.linux) {
|
||||
paths.push(phantomPath('phantomjs-*-linux-x86_64.tar.bz2'));
|
||||
paths.push(chromiumPath('chromium-*-linux.zip'));
|
||||
}
|
||||
return paths;
|
||||
};
|
||||
};
|
||||
for (const platform of config.getPlatforms()) {
|
||||
const getBrowserPaths = getBrowserPathsForPlatform(platform);
|
||||
if (platform.isWindows()) {
|
||||
await deleteAll(log, getBrowserPaths({ linux: true, darwin: true }));
|
||||
}
|
||||
else if (platform.isMac()) {
|
||||
await deleteAll(log, getBrowserPaths({ linux: true, windows: true }));
|
||||
} else if (platform.isLinux()) {
|
||||
await deleteAll(log, getBrowserPaths({ windows: true, darwin: true }));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue