bp2build: convert paths/module refs to Bazel label

This currently expands all globs, still need to support converting glob
syntax.

Test: go build_conversion_test
Test: GENERATE_BAZEL_FILES=true m nothing
Test: m nothing
Bug: 165114590
Change-Id: If7b26e8e663d17566fad9614ca87a8da1f095284
This commit is contained in:
Liz Kammer
2021-01-26 09:18:53 -05:00
parent aef038aac1
commit 356f7d45c1
27 changed files with 734 additions and 154 deletions

View File

@@ -2220,10 +2220,17 @@ func (b *baseModuleContext) getDirectDepInternal(name string, tag blueprint.Depe
}
var deps []dep
b.VisitDirectDepsBlueprint(func(module blueprint.Module) {
if aModule, _ := module.(Module); aModule != nil && aModule.base().BaseModuleName() == name {
returnedTag := b.bp.OtherModuleDependencyTag(aModule)
if aModule, _ := module.(Module); aModule != nil {
if aModule.base().BaseModuleName() == name {
returnedTag := b.bp.OtherModuleDependencyTag(aModule)
if tag == nil || returnedTag == tag {
deps = append(deps, dep{aModule, returnedTag})
}
}
} else if b.bp.OtherModuleName(module) == name {
returnedTag := b.bp.OtherModuleDependencyTag(module)
if tag == nil || returnedTag == tag {
deps = append(deps, dep{aModule, returnedTag})
deps = append(deps, dep{module, returnedTag})
}
}
})