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

@@ -77,6 +77,15 @@ func (cl ConditionList) String() string {
return sb.String()
}
// Names returns the list of the conditions' names.
func (cl ConditionList) Names() []string {
result := make([]string, 0, len(cl))
for _, lc := range cl {
result = append(result, lc.name)
}
return result
}
// HasByName returns true if the list contains any condition matching `name`.
func (cl ConditionList) HasByName(name ConditionNames) bool {
for _, lc := range cl {