Move ApexBundleInfoProvider from apex/ to android/
This provider contains information about the contents of an apex and is
set during the post deps phase of top-level source and prebuilt apexes.
java.dexpreoptDisabled needs to distinguish between platform and apex
variants of a library to prevent creating duplicate ninja rules. It does
so by looking at ApexInfoProvider. This provider gets set on the ctx of
the java_library being dexpreopted.
In case of prebuilts, these rules are being moved to the top-level
prebuilt apexes. Move ApexInfoBundleProvider from apex to android so
that java.dexpreoptDisabled can consume this provider without running
into a golang circular dependency. (java.dexpreoptDisabled will use this
provider in the next CL of this stack).
Test: go build ./android ./apex
Change-Id: I665abd9d0591eeb17b273cc822beb20690e6af09
diff --git a/apex/apex.go b/apex/apex.go
index 5b0def0..b069efd 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -929,12 +929,6 @@
var DCLAInfoProvider = blueprint.NewMutatorProvider[DCLAInfo]("apex_info")
-type ApexBundleInfo struct {
- Contents *android.ApexContents
-}
-
-var ApexBundleInfoProvider = blueprint.NewMutatorProvider[ApexBundleInfo]("apex_info")
-
var _ ApexInfoMutator = (*apexBundle)(nil)
func (a *apexBundle) ApexVariationName() string {
@@ -1035,7 +1029,7 @@
// The membership information is saved for later access
apexContents := android.NewApexContents(contents)
- android.SetProvider(mctx, ApexBundleInfoProvider, ApexBundleInfo{
+ android.SetProvider(mctx, android.ApexBundleInfoProvider, android.ApexBundleInfo{
Contents: apexContents,
})
@@ -1243,7 +1237,7 @@
if _, ok := mctx.Module().(android.ApexModule); ok {
var contents []*android.ApexContents
for _, testFor := range mctx.GetDirectDepsWithTag(testForTag) {
- abInfo, _ := android.OtherModuleProvider(mctx, testFor, ApexBundleInfoProvider)
+ abInfo, _ := android.OtherModuleProvider(mctx, testFor, android.ApexBundleInfoProvider)
contents = append(contents, abInfo.Contents)
}
android.SetProvider(mctx, android.ApexTestForInfoProvider, android.ApexTestForInfo{
@@ -2192,7 +2186,7 @@
af := apexFileForNativeLibrary(ctx, ch, vctx.handleSpecialLibs)
af.transitiveDep = true
- abInfo, _ := android.ModuleProvider(ctx, ApexBundleInfoProvider)
+ abInfo, _ := android.ModuleProvider(ctx, android.ApexBundleInfoProvider)
if !abInfo.Contents.DirectlyInApex(depName) && (ch.IsStubs() || ch.HasStubsVariants()) {
// If the dependency is a stubs lib, don't include it in this APEX,
// but make sure that the lib is installed on the device.
@@ -2658,7 +2652,7 @@
return
}
- abInfo, _ := android.ModuleProvider(ctx, ApexBundleInfoProvider)
+ abInfo, _ := android.ModuleProvider(ctx, android.ApexBundleInfoProvider)
a.WalkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
if ccm, ok := to.(*cc.Module); ok {