diff options
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r-- | java/platform_bootclasspath.go | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go index 05b8e2fa2..6503eca87 100644 --- a/java/platform_bootclasspath.go +++ b/java/platform_bootclasspath.go @@ -168,9 +168,7 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo return } - // Force the GlobalSoongConfig to be created and cached for use by the dex_bootjars - // GenerateSingletonBuildActions method as it cannot create it for itself. - dexpreopt.GetGlobalSoongConfig(ctx) + b.generateBootImageBuildActions(ctx) } func (b *platformBootclasspathModule) getImageConfig(ctx android.EarlyModuleContext) *bootImageConfig { @@ -297,3 +295,23 @@ func (b *platformBootclasspathModule) generatedHiddenAPIMetadataRules(ctx androi rule.Build("platform-bootclasspath-monolithic-hiddenapi-metadata", "monolithic hidden API metadata") } + +// generateBootImageBuildActions generates ninja rules related to the boot image creation. +func (b *platformBootclasspathModule) generateBootImageBuildActions(ctx android.ModuleContext) { + // Force the GlobalSoongConfig to be created and cached for use by the dex_bootjars + // GenerateSingletonBuildActions method as it cannot create it for itself. + dexpreopt.GetGlobalSoongConfig(ctx) + + imageConfig := b.getImageConfig(ctx) + if imageConfig == nil { + return + } + + global := dexpreopt.GetGlobalConfig(ctx) + if !shouldBuildBootImages(ctx.Config(), global) { + return + } + + // Generate the framework profile rule + bootFrameworkProfileRule(ctx, imageConfig) +} |