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:
37
java/java.go
37
java/java.go
@@ -270,6 +270,9 @@ func (j *Module) InstallBypassMake() bool { return true }
|
||||
type dependencyTag struct {
|
||||
blueprint.BaseDependencyTag
|
||||
name string
|
||||
|
||||
// True if the dependency is relinked at runtime.
|
||||
runtimeLinked bool
|
||||
}
|
||||
|
||||
// installDependencyTag is a dependency tag that is annotated to cause the installed files of the
|
||||
@@ -280,6 +283,15 @@ type installDependencyTag struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func (d dependencyTag) LicenseAnnotations() []android.LicenseAnnotation {
|
||||
if d.runtimeLinked {
|
||||
return []android.LicenseAnnotation{android.LicenseAnnotationSharedDependency}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var _ android.LicenseAnnotationsDependencyTag = dependencyTag{}
|
||||
|
||||
type usesLibraryDependencyTag struct {
|
||||
dependencyTag
|
||||
|
||||
@@ -296,10 +308,13 @@ type usesLibraryDependencyTag struct {
|
||||
|
||||
func makeUsesLibraryDependencyTag(sdkVersion int, optional bool, implicit bool) usesLibraryDependencyTag {
|
||||
return usesLibraryDependencyTag{
|
||||
dependencyTag: dependencyTag{name: fmt.Sprintf("uses-library-%d", sdkVersion)},
|
||||
sdkVersion: sdkVersion,
|
||||
optional: optional,
|
||||
implicit: implicit,
|
||||
dependencyTag: dependencyTag{
|
||||
name: fmt.Sprintf("uses-library-%d", sdkVersion),
|
||||
runtimeLinked: true,
|
||||
},
|
||||
sdkVersion: sdkVersion,
|
||||
optional: optional,
|
||||
implicit: implicit,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,22 +325,22 @@ func IsJniDepTag(depTag blueprint.DependencyTag) bool {
|
||||
var (
|
||||
dataNativeBinsTag = dependencyTag{name: "dataNativeBins"}
|
||||
staticLibTag = dependencyTag{name: "staticlib"}
|
||||
libTag = dependencyTag{name: "javalib"}
|
||||
java9LibTag = dependencyTag{name: "java9lib"}
|
||||
libTag = dependencyTag{name: "javalib", runtimeLinked: true}
|
||||
java9LibTag = dependencyTag{name: "java9lib", runtimeLinked: true}
|
||||
pluginTag = dependencyTag{name: "plugin"}
|
||||
errorpronePluginTag = dependencyTag{name: "errorprone-plugin"}
|
||||
exportedPluginTag = dependencyTag{name: "exported-plugin"}
|
||||
bootClasspathTag = dependencyTag{name: "bootclasspath"}
|
||||
systemModulesTag = dependencyTag{name: "system modules"}
|
||||
bootClasspathTag = dependencyTag{name: "bootclasspath", runtimeLinked: true}
|
||||
systemModulesTag = dependencyTag{name: "system modules", runtimeLinked: true}
|
||||
frameworkResTag = dependencyTag{name: "framework-res"}
|
||||
kotlinStdlibTag = dependencyTag{name: "kotlin-stdlib"}
|
||||
kotlinAnnotationsTag = dependencyTag{name: "kotlin-annotations"}
|
||||
kotlinStdlibTag = dependencyTag{name: "kotlin-stdlib", runtimeLinked: true}
|
||||
kotlinAnnotationsTag = dependencyTag{name: "kotlin-annotations", runtimeLinked: true}
|
||||
kotlinPluginTag = dependencyTag{name: "kotlin-plugin"}
|
||||
proguardRaiseTag = dependencyTag{name: "proguard-raise"}
|
||||
certificateTag = dependencyTag{name: "certificate"}
|
||||
instrumentationForTag = dependencyTag{name: "instrumentation_for"}
|
||||
extraLintCheckTag = dependencyTag{name: "extra-lint-check"}
|
||||
jniLibTag = dependencyTag{name: "jnilib"}
|
||||
jniLibTag = dependencyTag{name: "jnilib", runtimeLinked: true}
|
||||
syspropPublicStubDepTag = dependencyTag{name: "sysprop public stub"}
|
||||
jniInstallTag = installDependencyTag{name: "jni install"}
|
||||
binaryInstallTag = installDependencyTag{name: "binary install"}
|
||||
|
Reference in New Issue
Block a user