Handle already existing targets of different name
In other words, if, in bp2build, module "foo" would generate "foo", and "foo_two", and "foo_two" already exists in a build file, bp2build should label "foo" as being unconvertible. Fixes: 301321658 Fixes: 301312582 Bug: 285631638 Test: Unit tests Test: Verified that `m bp2build` results in bit-for-bit identical contents for out/soong/bp2build before and after this change. Change-Id: Icbbdd69fce83579ec9b172d04b2bf1f294698f70
This commit is contained in:
@@ -2022,10 +2022,9 @@ func (c *config) LogMixedBuild(ctx BaseModuleContext, useBazel bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *config) HasBazelBuildTargetInSource(ctx BaseModuleContext) bool {
|
||||
moduleName := ctx.Module().Name()
|
||||
for _, buildTarget := range c.bazelTargetsByDir[ctx.ModuleDir()] {
|
||||
if moduleName == buildTarget {
|
||||
func (c *config) HasBazelBuildTargetInSource(dir string, target string) bool {
|
||||
for _, existingTarget := range c.bazelTargetsByDir[dir] {
|
||||
if target == existingTarget {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user