Add dependency license annotations

Add annotations to dependency tags that are dynamic or classpath
linkage.

Bug: 207445310
Test: m checkbuild
Change-Id: Ife89b8f234aa40c380c721eda7dd18cab697fbb3
This commit is contained in:
Colin Cross
2021-11-22 17:53:20 -08:00
parent 3dd2ff28ed
commit b674b43656
4 changed files with 47 additions and 12 deletions

View File

@@ -969,6 +969,7 @@ type dependencyTag struct {
name string
library bool
procMacro bool
dynamic bool
}
// InstallDepNeeded returns true for rlibs, dylibs, and proc macros so that they or their transitive
@@ -979,10 +980,19 @@ func (d dependencyTag) InstallDepNeeded() bool {
var _ android.InstallNeededDependencyTag = dependencyTag{}
func (d dependencyTag) LicenseAnnotations() []android.LicenseAnnotation {
if d.library && d.dynamic {
return []android.LicenseAnnotation{android.LicenseAnnotationSharedDependency}
}
return nil
}
var _ android.LicenseAnnotationsDependencyTag = dependencyTag{}
var (
customBindgenDepTag = dependencyTag{name: "customBindgenTag"}
rlibDepTag = dependencyTag{name: "rlibTag", library: true}
dylibDepTag = dependencyTag{name: "dylib", library: true}
dylibDepTag = dependencyTag{name: "dylib", library: true, dynamic: true}
procMacroDepTag = dependencyTag{name: "procMacro", procMacro: true}
testPerSrcDepTag = dependencyTag{name: "rust_unit_tests"}
sourceDepTag = dependencyTag{name: "source"}