Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): suppress duplicate 3rdpartylicens…
Browse files Browse the repository at this point in the history
…es.txt warning

Refs #16193

This detects and filters out error messages about duplicate 3rdpartylicenses.txt. This is a short-term fix intended to get us to 9.0.x release while a follow up effort will work to properly fix this bug. Left a TODO to remove this filter once a fix is ready.

(cherry picked from commit 8c334d5)
  • Loading branch information
dgp1130 committed Jan 14, 2020
1 parent d9c3bb3 commit 1a1e4bf
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -84,12 +84,20 @@ export function statsToString(json: any, statsConfig: any) {
}
}

// TODO(#16193): Don't emit this warning in the first place rather than just suppressing it.
const ERRONEOUS_WARNINGS = [
/multiple assets emit different content.*3rdpartylicenses\.txt/i,
];
export function statsWarningsToString(json: any, statsConfig: any) {
const colors = statsConfig.colors;
const rs = (x: string) => colors ? reset(x) : x;
const y = (x: string) => colors ? bold(yellow(x)) : x;

return rs('\n' + json.warnings.map((warning: any) => y(`WARNING in ${warning}`)).join('\n\n'));
return rs('\n' + json.warnings
.map((warning: any) => `${warning}`)
.filter((warning: string) => !ERRONEOUS_WARNINGS.some((erroneous) => erroneous.test(warning)))
.map((warning: string) => y(`WARNING in ${warning}`))
.join('\n\n'));
}

export function statsErrorsToString(json: any, statsConfig: any) {
Expand Down

0 comments on commit 1a1e4bf

Please sign in to comment.