summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2025-03-04 19:30:25 +0000
committer Yu Liu <yudiliu@google.com> 2025-03-07 23:16:55 +0000
commite263a697bc5a17ddcabc36d9c16588a8743756db (patch)
tree1c3a55d22e89b70d2df663a1edeee432664e4f83 /apex/apex.go
parentef9e63e775493bd73cb28917ad59e6b10e5506b5 (diff)
Convert WalkPayloadDeps to use ModuleProxy.
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: If0d132c2310eb958c066747f9c16251cc24fedd0
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go31
1 files changed, 2 insertions, 29 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 5cdfc23fb..dc44e5849 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1607,33 +1607,6 @@ 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.CommonModuleInfoProvider).CanHaveApexVariants {
return false
@@ -2557,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.
@@ -2671,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