license metadata text notice files

Introduce the below command-line tool:

textnotice outputs a NOTICE text file constructed from the license
texts of the transitive closure of dependencies.

Bug: 68860345
Bug: 151177513
Bug: 151953481
Bug: 213388645
Bug: 210912771

Test: m all
Test: m systemlicense
Test: m textnotice; out/soong/host/linux-x85/textnotice ...

where ... is the path to the .meta_lic file for the system image. In my
case if

$ export PRODUCT=$(realpath $ANDROID_PRODUCT_OUT --relative-to=$PWD)

... can be expressed as:

${PRODUCT}/gen/META/lic_intermediates/${PRODUCT}/system.img.meta_lic

Change-Id: Ia691869fd8e58ef008024f48c23b1a4b4435677a
This commit is contained in:
Bob Badour
2021-12-09 22:10:43 -08:00
parent cf24fc2bf9
commit e6fdd1403b
63 changed files with 1449 additions and 75 deletions

View File

@@ -245,6 +245,15 @@ func (p *TargetEdgePath) Clear() {
*p = (*p)[:0]
}
// Copy makes a new path with the same value.
func (p *TargetEdgePath) Copy() *TargetEdgePath {
result := make(TargetEdgePath, 0, len(*p))
for _, e := range *p {
result = append(result, e)
}
return &result
}
// String returns a string representation of the path: [n1 -> n2 -> ... -> nn].
func (p *TargetEdgePath) String() string {
if p == nil {
@@ -357,6 +366,12 @@ func (tn *TargetNode) Installed() []string {
return append([]string{}, tn.proto.Installed...)
}
// TargetFiles returns the list of files built or installed by the module or
// target. (unordered)
func (tn *TargetNode) TargetFiles() []string {
return append(tn.proto.Built, tn.proto.Installed...)
}
// InstallMap returns the list of path name transformations to make to move
// files from their original location in the file system to their destination
// inside a container. (unordered)