Skip to content

Support for list of allowed licenses for 3rdpartylicenses.txt #31523

@nook24

Description

@nook24

Command

build

Description

When running ng build angular will generate the file 3rdpartylicenses.txt which contains information about 3rd party licenses included in the build result.
While this is awesome, it would be good to have an option to allow licenses that can be included in the build. For example MIT, Apache-2.0 and as soon as a license which is not allowed is included, the build should fail.

if (options.extractLicenses) {
executionResult.addOutputFile(
'3rdpartylicenses.txt',
await extractLicenses(metafile, workspaceRoot),
BuildOutputFileType.Root,
);
}

Describe the solution you'd like

In go, the package https://github.com/google/go-licenses for example supports --allowed_licenses=<comma separated license names>. As soon as a different license is found, the build fails. also php or other languages have tools for this.

Describe alternatives you've considered

Currently I'm trying to implement this using the npm package: https://www.npmjs.com/package/@onebeyond/license-checker

The issue is, that it includes a lot of npm packages which are not part of the final angular app - such as argparse for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions