summaryrefslogtreecommitdiff
path: root/java/bootclasspath_fragment.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-06-17 15:59:07 +0100
committer Paul Duffin <paulduffin@google.com> 2021-06-17 15:59:07 +0100
commitb4bbf2ca10cc8509e3ae0ab104e9e3b55861831b (patch)
treefdc943b8b60fee40016d31a2eae6f847fc619a3c /java/bootclasspath_fragment.go
parentfef5500a766d1f515ff19038e8e0e8f606e07287 (diff)
Simplify deapexer support
Uses the apex relative path to the file as the identifier that is used to obtain the path to the corresponding file extracted from the apex. That is instead of a special constructed string id. Bug: 177892522 Test: m nothing Change-Id: I5dc77c8fb272bac289b8891d1eac801e541af1f5
Diffstat (limited to 'java/bootclasspath_fragment.go')
-rw-r--r--java/bootclasspath_fragment.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index 317f3d2a0..cd0a216ca 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -930,13 +930,12 @@ func (module *prebuiltBootclasspathFragmentModule) produceBootImageFiles(ctx and
}
di := ctx.OtherModuleProvider(deapexerModule, android.DeapexerProvider).(android.DeapexerInfo)
- name := module.BaseModuleName()
for _, variant := range imageConfig.apexVariants() {
arch := variant.target.Arch.ArchType
for _, toPath := range variant.imagesDeps {
+ apexRelativePath := apexRootRelativePathToBootImageFile(arch, toPath.Base())
// Get the path to the file that the deapexer extracted from the prebuilt apex file.
- tag := createBootImageTag(arch, toPath.Base())
- fromPath := di.PrebuiltExportPath(name, tag)
+ fromPath := di.PrebuiltExportPath(apexRelativePath)
// Copy the file to the predefined location.
ctx.Build(pctx, android.BuildParams{
@@ -967,19 +966,16 @@ func createBootImageTag(arch android.ArchType, baseName string) string {
//
// If there is no image config associated with this fragment then it returns nil. Otherwise, it
// returns the files that are listed in the image config.
-func (module *prebuiltBootclasspathFragmentModule) RequiredFilesFromPrebuiltApex(ctx android.BaseModuleContext) map[string]string {
+func (module *prebuiltBootclasspathFragmentModule) RequiredFilesFromPrebuiltApex(ctx android.BaseModuleContext) []string {
imageConfig := module.getImageConfig(ctx)
if imageConfig != nil {
// Add the boot image files, e.g. .art, .oat and .vdex files.
- files := map[string]string{}
- name := module.BaseModuleName()
+ files := []string{}
for _, variant := range imageConfig.apexVariants() {
arch := variant.target.Arch.ArchType
for _, path := range variant.imagesDeps.Paths() {
base := path.Base()
- tag := createBootImageTag(arch, base)
- key := fmt.Sprintf("%s{%s}", name, tag)
- files[key] = filepath.Join("javalib", arch.String(), base)
+ files = append(files, apexRootRelativePathToBootImageFile(arch, base))
}
}
return files
@@ -987,6 +983,10 @@ func (module *prebuiltBootclasspathFragmentModule) RequiredFilesFromPrebuiltApex
return nil
}
+func apexRootRelativePathToBootImageFile(arch android.ArchType, base string) string {
+ return filepath.Join("javalib", arch.String(), base)
+}
+
var _ android.RequiredFilesFromPrebuiltApex = (*prebuiltBootclasspathFragmentModule)(nil)
func prebuiltBootclasspathFragmentFactory() android.Module {