Refactor cc/rust to prep for Rust stubs
This CL largely handles this refactoring in preparation for Rust stubs
support.
Rust modules need to be able to communicate stubs information to cc, and
certain bits of cc needs to be exported so rust can reuse them.
A new VersionedLinkableInterface is added to capture most of the
stubs-related interface definitions.
Bug: 203478530
Test: m blueprint_tests
Change-Id: I380225402fa85a3c39e7b18deb657054b3a52fbe
diff --git a/java/app.go b/java/app.go
index 12705b0..8a2afbd 100644
--- a/java/app.go
+++ b/java/app.go
@@ -1127,9 +1127,10 @@
parentLinkable, _ := parent.(cc.LinkableInterface)
useStubsOfDep := childLinkable.IsStubs()
if apkInApex && parentLinkable != nil {
+ vintf := childLinkable.(cc.VersionedLinkableInterface).VersionedInterface()
// APK-in-APEX
// If the parent is a linkable interface, use stubs if the dependency edge crosses an apex boundary.
- useStubsOfDep = useStubsOfDep || (childLinkable.HasStubsVariants() && cc.ShouldUseStubForApex(ctx, parent, child))
+ useStubsOfDep = useStubsOfDep || (vintf.HasStubsVariants() && cc.ShouldUseStubForApex(ctx, parent, child))
}
return !childLinkable.IsNdk(ctx.Config()) && !useStubsOfDep
})