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
diff --git a/bp2build/aar_conversion_test.go b/bp2build/aar_conversion_test.go
index 59aacbb..40356a1 100644
--- a/bp2build/aar_conversion_test.go
+++ b/bp2build/aar_conversion_test.go
@@ -110,7 +110,7 @@
"import.aar": "",
"dep.aar": "",
},
- StubbedBuildDefinitions: []string{"static_lib_dep", "prebuilt_static_import_dep"},
+ StubbedBuildDefinitions: []string{"static_lib_dep", "static_import_dep", "static_import_dep-neverlink"},
// Bazel's aar_import can only export *_import targets, so we expect
// only "static_import_dep" in exports, but both "static_lib_dep" and
// "static_import_dep" in deps
@@ -125,6 +125,7 @@
// TODO: b/301007952 - This dep is needed because android_library_import must have aars set.
android_library_import {
name: "static_import_dep",
+ aars: ["import.aar"],
}
`,
ExpectedBazelTargets: []string{