diff options
Diffstat (limited to 'apex/apex.go')
-rw-r--r-- | apex/apex.go | 43 |
1 files changed, 11 insertions, 32 deletions
diff --git a/apex/apex.go b/apex/apex.go index 196f389d2..dc44e5849 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -550,6 +550,9 @@ type apexBundle struct { // Required modules, filled out during GenerateAndroidBuildActions and used in AndroidMk required []string + + // appinfo of the apk-in-apex of this module + appInfos java.AppInfos } // apexFileClass represents a type of file that can be included in APEX. @@ -1499,7 +1502,7 @@ func apexFileForJavaModule(ctx android.ModuleContext, module android.Module, jav func apexFileForJavaModuleWithFile(ctx android.ModuleContext, module android.Module, javaInfo *java.JavaInfo, dexImplementationJar android.Path) apexFile { dirInApex := "javalib" - commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey) + commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider) af := newApexFile(ctx, dexImplementationJar, commonInfo.BaseModuleName, dirInApex, javaSharedLib, module) af.jacocoReportClassesFile = javaInfo.JacocoReportClassesFile if lintInfo, ok := android.OtherModuleProvider(ctx, module, java.LintProvider); ok { @@ -1604,35 +1607,8 @@ func apexFileForFilesystem(ctx android.BaseModuleContext, buildFile android.Path // to the child modules. Returning false makes the visit to continue in the sibling or the parent // modules. This is used in check* functions below. func (a *apexBundle) WalkPayloadDeps(ctx android.BaseModuleContext, do android.PayloadDepsCallback) { - ctx.WalkDeps(func(child, parent android.Module) bool { - am, ok := child.(android.ApexModule) - if !ok || !am.CanHaveApexVariants() { - return false - } - - // Filter-out unwanted depedendencies - depTag := ctx.OtherModuleDependencyTag(child) - if _, ok := depTag.(android.ExcludeFromApexContentsTag); ok { - return false - } - if dt, ok := depTag.(*dependencyTag); ok && !dt.payload { - return false - } - if depTag == android.RequiredDepTag { - return false - } - - externalDep := !android.IsDepInSameApex(ctx, parent, child) - - // Visit actually - return do(ctx, parent, am, externalDep) - }) -} - -func (a *apexBundle) WalkPayloadDepsProxy(ctx android.BaseModuleContext, - do func(ctx android.BaseModuleContext, from, to android.ModuleProxy, externalDep bool) bool) { ctx.WalkDepsProxy(func(child, parent android.ModuleProxy) bool { - if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoKey).CanHaveApexVariants { + if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoProvider).CanHaveApexVariants { return false } // Filter-out unwanted depedendencies @@ -1845,7 +1821,7 @@ func (a *apexBundle) depVisitor(vctx *visitorContext, ctx android.ModuleContext, if _, ok := depTag.(android.ExcludeFromApexContentsTag); ok { return false } - commonInfo := android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoKey) + commonInfo := android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoProvider) if !commonInfo.Enabled { return false } @@ -1931,6 +1907,7 @@ func (a *apexBundle) depVisitor(vctx *visitorContext, ctx android.ModuleContext, } case androidAppTag: if appInfo, ok := android.OtherModuleProvider(ctx, child, java.AppInfoProvider); ok { + a.appInfos = append(a.appInfos, *appInfo) if appInfo.AppSet { appDir := "app" if appInfo.Privileged { @@ -2267,6 +2244,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { }) android.SetProvider(ctx, filesystem.ApexKeyPathInfoProvider, filesystem.ApexKeyPathInfo{a.apexKeysPath}) + + android.SetProvider(ctx, java.AppInfosProvider, a.appInfos) } // Set prebuiltInfoProvider. This will be used by `apex_prebuiltinfo_singleton` to print out a metadata file @@ -2551,7 +2530,7 @@ func (a *apexBundle) checkStaticLinkingToStubLibraries(ctx android.ModuleContext librariesDirectlyInApex[ctx.OtherModuleName(dep)] = true }) - a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from android.Module, to android.ApexModule, externalDep bool) bool { + a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from, to android.ModuleProxy, externalDep bool) bool { if info, ok := android.OtherModuleProvider(ctx, to, cc.LinkableInfoProvider); ok { // If `to` is not actually in the same APEX as `from` then it does not need // apex_available and neither do any of its dependencies. @@ -2665,7 +2644,7 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) { return } - a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from android.Module, to android.ApexModule, externalDep bool) bool { + a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from, to android.ModuleProxy, externalDep bool) bool { // As soon as the dependency graph crosses the APEX boundary, don't go further. if externalDep { return false |