diff options
author | Paul Duffin <paulduffin@google.com> | 2021-06-02 17:24:22 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2021-06-16 03:06:35 +0100 |
commit | 3e2db5c10bd9c1f7563746dcf721aef44b075b1e (patch) | |
tree | c18b5d94addc6201e9dbf4dba54916dd18a09964 /java/platform_bootclasspath.go | |
parent | 8c666a36654ea680ba1f45c87365870a6fd3476e (diff) |
Make copyBootJarsToPredefinedLocations simpler and less fragile
Previously, copyBootJarsToPredefinedLocations relied on all its
parameters having the same length and the same order. That made it
quite fragile as changes to one of the parameters without corresponding
changes to the other would cause failures. It also combined the
retrieval of the boot dex jars from the modules, handling of missing
boot dex jar files and the generation of the rules to copy the files.
This change separates the retrieval of boot dex jars and handling of
missing files from the copying of those files while at the same time
making the function less fragile by replacing the three ordered
parameters with two maps that shared common keys.
Bug: 179354495
Test: m nothing
Merged-In: Idbcd24a7e8af89f7895a20aeddc58502dcbaad03
Change-Id: Idbcd24a7e8af89f7895a20aeddc58502dcbaad03
(cherry picked from commit 5f148ca7cf2e9a9478922577b7ed70b1caacb55e)
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r-- | java/platform_bootclasspath.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go index 7d1e53f8c..a4beb8970 100644 --- a/java/platform_bootclasspath.go +++ b/java/platform_bootclasspath.go @@ -389,11 +389,13 @@ func (b *platformBootclasspathModule) generateBootImageBuildActions(ctx android. generateUpdatableBcpPackagesRule(ctx, imageConfig, updatableModules) // Copy non-updatable module dex jars to their predefined locations. - copyBootJarsToPredefinedLocations(ctx, nonUpdatableModules, imageConfig.modules, imageConfig.dexPaths) + nonUpdatableBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, nonUpdatableModules) + copyBootJarsToPredefinedLocations(ctx, nonUpdatableBootDexJarsByModule, imageConfig.dexPathsByModule) // Copy updatable module dex jars to their predefined locations. config := GetUpdatableBootConfig(ctx) - copyBootJarsToPredefinedLocations(ctx, updatableModules, config.modules, config.dexPaths) + updatableBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, updatableModules) + copyBootJarsToPredefinedLocations(ctx, updatableBootDexJarsByModule, config.dexPathsByModule) // Build a profile for the image config and then use that to build the boot image. profile := bootImageProfileRule(ctx, imageConfig) |