Special case platform variant of bootstrap libs
Platform variants of libraries that set `bootstrap: true` in their
Android.bp file gets impl in Soong. This CL ports this behavior to
bp2build.
Note that even after this CL, there will be still be some other cases
where stub/impl logic does not match Soong perfectly (most notably the
platform_apis property which is propagated top-down from the parent
apex).
Test: bp2build.sh
Change-Id: I3da284ab42631d6de1c0d52e56ccbfd4e4a09f1d
diff --git a/cc/bp2build.go b/cc/bp2build.go
index c42a7e8..33eafe3 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -1357,6 +1357,9 @@
// that tests of an apex library gets its implementation and not stubs.
// TODO (b/280343104): Discuss if we can drop this special handling for platform variants.
sameApiDomain = availableToSameApexes(apexAvailable, dep.(*Module).ApexAvailable())
+ if linkable, ok := ctx.Module().(LinkableInterface); ok && linkable.Bootstrap() {
+ sameApiDomain = true
+ }
} else {
sameApiDomain = android.InList(apiDomain, dep.(*Module).ApexAvailable())
}