summaryrefslogtreecommitdiff
path: root/java/platform_bootclasspath.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2021-04-22 12:08:59 +0100
committerPaul Duffin <paulduffin@google.com>2021-04-23 09:32:14 +0100
commit4994d26bfac6791f3729c5a1331f89c6ab20765e (patch)
tree0f13ec221beb114835577232983e951f5b6b9c26 /java/platform_bootclasspath.go
parentb67d878b8008866fbab73b1b7f3b4457d6c6ea1b (diff)
Generalize the platformBootclasspathDepsMutator
Adds a BootclasspathDepsMutator that is currently only implemented by the platform_bootclasspath but which can be implemented by bootclasspath_fragment too. Bug: 177892522 Test: m nothing Change-Id: Ibe35854281004d6e40bf1f797144fb582e8c08b9
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r--java/platform_bootclasspath.go33
1 files changed, 13 insertions, 20 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go
index 38ce98525..b1a0ac43f 100644
--- a/java/platform_bootclasspath.go
+++ b/java/platform_bootclasspath.go
@@ -27,10 +27,6 @@ func init() {
func registerPlatformBootclasspathBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("platform_bootclasspath", platformBootclasspathFactory)
-
- ctx.FinalDepsMutators(func(ctx android.RegisterMutatorsContext) {
- ctx.BottomUp("platform_bootclasspath_deps", platformBootclasspathDepsMutator)
- })
}
// The tag used for the dependency between the platform bootclasspath and any configured boot jars.
@@ -126,25 +122,22 @@ func (b *platformBootclasspathModule) hiddenAPIDepsMutator(ctx android.BottomUpM
hiddenAPIAddStubLibDependencies(ctx, sdkKindToStubLibModules)
}
-func platformBootclasspathDepsMutator(ctx android.BottomUpMutatorContext) {
- m := ctx.Module()
- if p, ok := m.(*platformBootclasspathModule); ok {
- // Add dependencies on all the modules configured in the "art" boot image.
- artImageConfig := genBootImageConfigs(ctx)[artBootImageName]
- addDependenciesOntoBootImageModules(ctx, artImageConfig.modules)
+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)
- // Add dependencies on all the modules configured in the "boot" boot image. That does not
- // include modules configured in the "art" boot image.
- bootImageConfig := p.getImageConfig(ctx)
- addDependenciesOntoBootImageModules(ctx, bootImageConfig.modules)
+ // Add dependencies on all the modules 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)
- // Add dependencies on all the updatable modules.
- updatableModules := dexpreopt.GetGlobalConfig(ctx).UpdatableBootJars
- addDependenciesOntoBootImageModules(ctx, updatableModules)
+ // Add dependencies on all the updatable modules.
+ updatableModules := dexpreopt.GetGlobalConfig(ctx).UpdatableBootJars
+ addDependenciesOntoBootImageModules(ctx, updatableModules)
- // Add dependencies on all the fragments.
- p.properties.BootclasspathFragmentsDepsProperties.addDependenciesOntoFragments(ctx)
- }
+ // Add dependencies on all the fragments.
+ b.properties.BootclasspathFragmentsDepsProperties.addDependenciesOntoFragments(ctx)
}
func addDependenciesOntoBootImageModules(ctx android.BottomUpMutatorContext, modules android.ConfiguredJarList) {