compliance package for license metadata: dumpgraph

package to read, consume, and analyze license metadata and dependency
graph.

Includes testdata/ and the the below command-line tool:

dumpgraph outputs edges of the graph as "target dependency annotations"

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense
Test: m dumpgraph; out/soong/host/linux-x86/dumpgraph ...

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: I5fe57d361da5155dbcb2c0d369626e9200c9d664
This commit is contained in:
Bob Badour
2021-10-25 16:21:00 -07:00
parent 8fb2d83457
commit fa739da020
56 changed files with 2686 additions and 0 deletions

View File

@@ -150,6 +150,15 @@ func (cs *LicenseConditionSet) AsList() ConditionList {
return result
}
// Names returns a list of the names of the conditions in the set.
func (cs *LicenseConditionSet) Names() []string {
result := make([]string, 0, len(cs.conditions))
for name := range cs.conditions {
result = append(result, name)
}
return result
}
// Count returns the number of conditions in the set.
func (cs *LicenseConditionSet) Count() int {
size := 0