diff --git a/android/module.go b/android/module.go index 1409d44b1..bf74cad07 100644 --- a/android/module.go +++ b/android/module.go @@ -2374,6 +2374,16 @@ func (b *baseModuleContext) FinalModule() Module { return b.bp.FinalModule().(Module) } +// IsMetaDependencyTag returns true for cross-cutting metadata dependencies. +func IsMetaDependencyTag(tag blueprint.DependencyTag) bool { + if tag == licenseKindTag { + return true + } else if tag == licensesTag { + return true + } + return false +} + // A regexp for removing boilerplate from BaseDependencyTag from the string representation of // a dependency tag. var tagCleaner = regexp.MustCompile(`\QBaseDependencyTag:{}\E(, )?`) diff --git a/java/boot_image.go b/java/boot_image.go index 0a525b752..8a1e3c957 100644 --- a/java/boot_image.go +++ b/java/boot_image.go @@ -90,6 +90,10 @@ func (b *BootImageModule) DepIsInSameApex(ctx android.BaseModuleContext, dep and // The dex2oat tool is only needed for building and is not required in the apex. return false } + if android.IsMetaDependencyTag(tag) { + // Cross-cutting metadata dependencies are metadata. + return false + } panic(fmt.Errorf("boot_image module %q should not have a dependency on %q via tag %s", b, dep, android.PrettyPrintTag(tag))) }