summaryrefslogtreecommitdiff
path: root/java/bootclasspath_fragment.go
diff options
context:
space:
mode:
author Martin Stjernholm <mast@google.com> 2021-09-17 01:44:12 +0100
committer Martin Stjernholm <mast@google.com> 2021-09-23 17:19:55 +0100
commit4482560cc73f16f09eecda42751cf2f8dc72e7de (patch)
tree21b3906c4fa5b2844bc9bb7527e26a4d0d6df17e /java/bootclasspath_fragment.go
parent8be1e6db1640d51ca4478fec2c4f20d71b115734 (diff)
Consolidate the code to resolve a deapexer module dependency.
It will get more logic in upcoming CLs. Add a property to DeapexerInfo for the APEX name, for use in error messages. Test: m nothing Bug: 192006406 Change-Id: I957f3df8b34543a38cde38768dac93e78132d672
Diffstat (limited to 'java/bootclasspath_fragment.go')
-rw-r--r--java/bootclasspath_fragment.go18
1 files changed, 3 insertions, 15 deletions
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index b13e2dba4..79c73ca87 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -954,23 +954,11 @@ func (module *prebuiltBootclasspathFragmentModule) produceBootImageFiles(ctx and
return nil
}
- var deapexerModule android.Module
- ctx.VisitDirectDeps(func(module android.Module) {
- tag := ctx.OtherModuleDependencyTag(module)
- // Save away the `deapexer` module on which this depends, if any.
- if tag == android.DeapexerTag {
- deapexerModule = module
- }
- })
-
- if deapexerModule == nil {
- // This should never happen as a variant for a prebuilt_apex is only created if the
- // deapexer module has been configured to export the dex implementation jar for this module.
- ctx.ModuleErrorf("internal error: module does not depend on a `deapexer` module")
- return nil
+ di := android.FindDeapexerProviderForModule(ctx)
+ if di == nil {
+ return nil // An error has been reported by FindDeapexerProviderForModule.
}
- di := ctx.OtherModuleProvider(deapexerModule, android.DeapexerProvider).(android.DeapexerInfo)
files := bootImageFilesByArch{}
for _, variant := range imageConfig.apexVariants() {
arch := variant.target.Arch.ArchType