diff options
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r-- | java/platform_bootclasspath.go | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go index f126e13b6..790445244 100644 --- a/java/platform_bootclasspath.go +++ b/java/platform_bootclasspath.go @@ -29,8 +29,13 @@ func registerPlatformBootclasspathBuildComponents(ctx android.RegistrationContex ctx.RegisterModuleType("platform_bootclasspath", platformBootclasspathFactory) } -// The tag used for the dependency between the platform bootclasspath and any configured boot jars. -var platformBootclasspathModuleDepTag = bootclasspathDependencyTag{name: "module"} +// The tags used for the dependencies between the platform bootclasspath and any configured boot +// jars. +var ( + platformBootclasspathArtBootJarDepTag = bootclasspathDependencyTag{name: "art-boot-jar"} + platformBootclasspathNonUpdatableBootJarDepTag = bootclasspathDependencyTag{name: "non-updatable-boot-jar"} + platformBootclasspathUpdatableBootJarDepTag = bootclasspathDependencyTag{name: "updatable-boot-jar"} +) type platformBootclasspathModule struct { android.ModuleBase @@ -125,34 +130,46 @@ func (b *platformBootclasspathModule) hiddenAPIDepsMutator(ctx android.BottomUpM func (b *platformBootclasspathModule) BootclasspathDepsMutator(ctx android.BottomUpMutatorContext) { // Add dependencies on all the modules configured in the "art" boot image. artImageConfig := genBootImageConfigs(ctx)[artBootImageName] - addDependenciesOntoBootImageModules(ctx, artImageConfig.modules) + addDependenciesOntoBootImageModules(ctx, artImageConfig.modules, platformBootclasspathArtBootJarDepTag) - // Add dependencies on all the modules configured in the "boot" boot image. That does not - // include modules configured in the "art" boot image. + // Add dependencies on all the non-updatable module configured in the "boot" boot image. That does + // not include modules configured in the "art" boot image. bootImageConfig := b.getImageConfig(ctx) - addDependenciesOntoBootImageModules(ctx, bootImageConfig.modules) + addDependenciesOntoBootImageModules(ctx, bootImageConfig.modules, platformBootclasspathNonUpdatableBootJarDepTag) // Add dependencies on all the updatable modules. updatableModules := dexpreopt.GetGlobalConfig(ctx).UpdatableBootJars - addDependenciesOntoBootImageModules(ctx, updatableModules) + addDependenciesOntoBootImageModules(ctx, updatableModules, platformBootclasspathUpdatableBootJarDepTag) // Add dependencies on all the fragments. b.properties.BootclasspathFragmentsDepsProperties.addDependenciesOntoFragments(ctx) } -func addDependenciesOntoBootImageModules(ctx android.BottomUpMutatorContext, modules android.ConfiguredJarList) { +func addDependenciesOntoBootImageModules(ctx android.BottomUpMutatorContext, modules android.ConfiguredJarList, tag bootclasspathDependencyTag) { for i := 0; i < modules.Len(); i++ { apex := modules.Apex(i) name := modules.Jar(i) - addDependencyOntoApexModulePair(ctx, apex, name, platformBootclasspathModuleDepTag) + addDependencyOntoApexModulePair(ctx, apex, name, tag) } } func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { b.classpathFragmentBase().generateAndroidBuildActions(ctx) - b.configuredModules = gatherApexModulePairDepsWithTag(ctx, platformBootclasspathModuleDepTag) + // Gather all the dependencies from the art, updatable and non-updatable boot jars. + artModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathArtBootJarDepTag) + nonUpdatableModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathNonUpdatableBootJarDepTag) + updatableModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathUpdatableBootJarDepTag) + + // Concatenate them all, in order as they would appear on the bootclasspath. + var allModules []android.Module + allModules = append(allModules, artModules...) + allModules = append(allModules, nonUpdatableModules...) + allModules = append(allModules, updatableModules...) + b.configuredModules = allModules + + // Gather all the fragments dependencies. b.fragments = gatherApexModulePairDepsWithTag(ctx, bootclasspathFragmentDepTag) b.generateHiddenAPIBuildActions(ctx, b.configuredModules, b.fragments) |