Merge "Allow cross-cutting dependencies like licenses." am: a3348295d4

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1579112

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia86275340d8cda63c3cea72d487682aee3064f7d
This commit is contained in:
Bob Badour
2021-02-10 03:10:42 +00:00
committed by Automerger Merge Worker
2 changed files with 14 additions and 0 deletions

View File

@@ -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(, )?`)

View File

@@ -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)))
}