diff options
author | Paul Duffin <paulduffin@google.com> | 2021-04-28 21:16:02 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2021-04-29 11:34:59 +0100 |
commit | 9bacf56564d6d5bf50d6320a25a9ecb373ba2ef4 (patch) | |
tree | 20c7e1e2c1f52171a5e323cd071e9d62539d825f /java/platform_bootclasspath.go | |
parent | 110b0add9e9ec1ad87751c11975900af065ed5e8 (diff) |
Extract logic to gather deps added for <apex>:<module> pairs
Trades having to traverse a module's direct dependencies multiple times
for reusable code. While at the minute the amount of duplicated code is
small (checking a tag and appending to a list) follow up changes will
modify the gatherApexModulePairDepsWithTag module to improve error
reporting greatly increasing the benefit of deduping.
The cost of traversing a module's direct dependencies is very small as
there will be only a very few dependencies.
Bug: 177892522
Test: m nothing
Change-Id: I16389102abd8038e1bfa52b63f4153bdf92ff553
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r-- | java/platform_bootclasspath.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go index 6503eca87..f126e13b6 100644 --- a/java/platform_bootclasspath.go +++ b/java/platform_bootclasspath.go @@ -152,14 +152,8 @@ func addDependenciesOntoBootImageModules(ctx android.BottomUpMutatorContext, mod func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { b.classpathFragmentBase().generateAndroidBuildActions(ctx) - ctx.VisitDirectDepsIf(isActiveModule, func(module android.Module) { - tag := ctx.OtherModuleDependencyTag(module) - if tag == platformBootclasspathModuleDepTag { - b.configuredModules = append(b.configuredModules, module) - } else if tag == bootclasspathFragmentDepTag { - b.fragments = append(b.fragments, module) - } - }) + b.configuredModules = gatherApexModulePairDepsWithTag(ctx, platformBootclasspathModuleDepTag) + b.fragments = gatherApexModulePairDepsWithTag(ctx, bootclasspathFragmentDepTag) b.generateHiddenAPIBuildActions(ctx, b.configuredModules, b.fragments) |