Add VisitDirectDepsWithTag

Add a method on ModuleContext and TopDownMutatorContext to visit
direct dependencies that have a given dependency tag.

Test: m checkbuild
Change-Id: Ib875563091dcae6b7282b3e3427d0eb07d8c8af5
This commit is contained in:
Colin Cross
2017-12-30 17:54:27 -08:00
parent b4330e222b
commit ee6143cde2
6 changed files with 32 additions and 21 deletions

View File

@@ -112,11 +112,9 @@ type SystemModulesProperties struct {
func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleContext) {
var jars android.Paths
ctx.VisitDirectDeps(func(module android.Module) {
if ctx.OtherModuleDependencyTag(module) == libTag {
dep, _ := module.(Dependency)
jars = append(jars, dep.HeaderJars()...)
}
ctx.VisitDirectDepsWithTag(libTag, func(module android.Module) {
dep, _ := module.(Dependency)
jars = append(jars, dep.HeaderJars()...)
})
jars = append(jars, android.PathsForModuleSrc(ctx, system.properties.Jars)...)