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/cc_library_shared_conversion_test.go b/bp2build/cc_library_shared_conversion_test.go
index bdde996..6fa14e3 100644
--- a/bp2build/cc_library_shared_conversion_test.go
+++ b/bp2build/cc_library_shared_conversion_test.go
@@ -1595,7 +1595,7 @@
Description: "cc_library_shared stubs",
ModuleTypeUnderTest: "cc_library_shared",
ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
- StubbedBuildDefinitions: []string{"libNoStubs", "libHasApexStubs", "libHasApexAndNdkStubs"},
+ StubbedBuildDefinitions: []string{"libNoStubs", "libHasApexStubs", "libHasApexAndNdkStubs", "libHasApexAndNdkStubs.ndk_stub_libs"},
Blueprint: soongCcLibrarySharedPreamble + `
cc_library_shared {
name: "libUsesSdk",
@@ -1621,9 +1621,7 @@
}
ndk_library {
name: "libHasApexAndNdkStubs",
- // TODO: b/301321658 - Stub this once existing-build-file handling can deal with
- // modules that generate targets of a different name.
- bazel_module: { bp2build_available: false },
+ first_version: "28",
}
`,
ExpectedBazelTargets: []string{