blob: 29d2df0cdc49f0444b3abdf5d1ea16c567a8e1c4 [file] [log] [blame]
Paul Duffinbb7f1ac2021-03-29 22:18:45 +01001// Copyright 2021 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package java
16
17import (
Paul Duffin6a766452021-04-12 14:15:22 +010018 "fmt"
19
Paul Duffinbb7f1ac2021-03-29 22:18:45 +010020 "android/soong/android"
21 "android/soong/dexpreopt"
22)
23
24func init() {
25 registerPlatformBootclasspathBuildComponents(android.InitRegistrationContext)
26}
27
28func registerPlatformBootclasspathBuildComponents(ctx android.RegistrationContext) {
Paul Duffine3ecce62021-04-29 10:34:11 +010029 ctx.RegisterSingletonModuleType("platform_bootclasspath", platformBootclasspathFactory)
Paul Duffinbb7f1ac2021-03-29 22:18:45 +010030}
31
Paul Duffin01b463b2021-04-26 20:05:39 +010032// The tags used for the dependencies between the platform bootclasspath and any configured boot
33// jars.
34var (
35 platformBootclasspathArtBootJarDepTag = bootclasspathDependencyTag{name: "art-boot-jar"}
36 platformBootclasspathNonUpdatableBootJarDepTag = bootclasspathDependencyTag{name: "non-updatable-boot-jar"}
37 platformBootclasspathUpdatableBootJarDepTag = bootclasspathDependencyTag{name: "updatable-boot-jar"}
38)
Paul Duffinb432df92021-03-22 22:09:42 +000039
Paul Duffinbb7f1ac2021-03-29 22:18:45 +010040type platformBootclasspathModule struct {
Paul Duffine3ecce62021-04-29 10:34:11 +010041 android.SingletonModuleBase
Artur Satayev97259dc2021-04-07 15:17:14 +010042 ClasspathFragmentBase
Paul Duffinb432df92021-03-22 22:09:42 +000043
Paul Duffin62d8c3b2021-04-07 20:35:11 +010044 properties platformBootclasspathProperties
45
Paul Duffinb432df92021-03-22 22:09:42 +000046 // The apex:module pairs obtained from the configured modules.
47 //
48 // Currently only for testing.
49 configuredModules []android.Module
Paul Duffin62d8c3b2021-04-07 20:35:11 +010050
51 // The apex:module pairs obtained from the fragments.
52 //
53 // Currently only for testing.
54 fragments []android.Module
Paul Duffin6a766452021-04-12 14:15:22 +010055
56 // Path to the monolithic hiddenapi-flags.csv file.
Paul Duffin0b659862021-04-13 13:02:29 +010057 hiddenAPIFlagsCSV android.OutputPath
Paul Duffin6a766452021-04-12 14:15:22 +010058
59 // Path to the monolithic hiddenapi-index.csv file.
Paul Duffin0b659862021-04-13 13:02:29 +010060 hiddenAPIIndexCSV android.OutputPath
Paul Duffin6a766452021-04-12 14:15:22 +010061
62 // Path to the monolithic hiddenapi-unsupported.csv file.
Paul Duffin0b659862021-04-13 13:02:29 +010063 hiddenAPIMetadataCSV android.OutputPath
Paul Duffin62d8c3b2021-04-07 20:35:11 +010064}
65
Paul Duffin62d8c3b2021-04-07 20:35:11 +010066type platformBootclasspathProperties struct {
Paul Duffinb67d8782021-04-22 11:49:41 +010067 BootclasspathFragmentsDepsProperties
Paul Duffin702210b2021-04-08 20:12:41 +010068
Paul Duffin46169772021-04-14 15:01:56 +010069 Hidden_api HiddenAPIFlagFileProperties
Paul Duffinbb7f1ac2021-03-29 22:18:45 +010070}
71
Paul Duffine3ecce62021-04-29 10:34:11 +010072func platformBootclasspathFactory() android.SingletonModule {
Paul Duffinbb7f1ac2021-03-29 22:18:45 +010073 m := &platformBootclasspathModule{}
Paul Duffin62d8c3b2021-04-07 20:35:11 +010074 m.AddProperties(&m.properties)
Artur Satayev97259dc2021-04-07 15:17:14 +010075 // TODO(satayev): split systemserver and apex jars into separate configs.
76 initClasspathFragment(m)
Paul Duffinbb7f1ac2021-03-29 22:18:45 +010077 android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
78 return m
79}
80
Paul Duffin6a766452021-04-12 14:15:22 +010081var _ android.OutputFileProducer = (*platformBootclasspathModule)(nil)
82
Artur Satayev97259dc2021-04-07 15:17:14 +010083func (b *platformBootclasspathModule) AndroidMkEntries() (entries []android.AndroidMkEntries) {
84 entries = append(entries, android.AndroidMkEntries{
85 Class: "FAKE",
86 // Need at least one output file in order for this to take effect.
87 OutputFile: android.OptionalPathForPath(b.hiddenAPIFlagsCSV),
88 Include: "$(BUILD_PHONY_PACKAGE)",
89 })
90 entries = append(entries, b.classpathFragmentBase().getAndroidMkEntries()...)
91 return
Paul Duffin6a766452021-04-12 14:15:22 +010092}
93
94// Make the hidden API files available from the platform-bootclasspath module.
95func (b *platformBootclasspathModule) OutputFiles(tag string) (android.Paths, error) {
96 switch tag {
97 case "hiddenapi-flags.csv":
98 return android.Paths{b.hiddenAPIFlagsCSV}, nil
99 case "hiddenapi-index.csv":
100 return android.Paths{b.hiddenAPIIndexCSV}, nil
101 case "hiddenapi-metadata.csv":
102 return android.Paths{b.hiddenAPIMetadataCSV}, nil
103 }
104
105 return nil, fmt.Errorf("unknown tag %s", tag)
106}
107
Paul Duffinbb7f1ac2021-03-29 22:18:45 +0100108func (b *platformBootclasspathModule) DepsMutator(ctx android.BottomUpMutatorContext) {
Paul Duffin74431d52021-04-21 14:10:42 +0100109 b.hiddenAPIDepsMutator(ctx)
110
Paul Duffinbb7f1ac2021-03-29 22:18:45 +0100111 if SkipDexpreoptBootJars(ctx) {
112 return
113 }
114
115 // Add a dependency onto the dex2oat tool which is needed for creating the boot image. The
116 // path is retrieved from the dependency by GetGlobalSoongConfig(ctx).
117 dexpreopt.RegisterToolDeps(ctx)
118}
119
Paul Duffin74431d52021-04-21 14:10:42 +0100120func (b *platformBootclasspathModule) hiddenAPIDepsMutator(ctx android.BottomUpMutatorContext) {
121 if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
122 return
123 }
124
125 // Add dependencies onto the stub lib modules.
126 sdkKindToStubLibModules := hiddenAPIComputeMonolithicStubLibModules(ctx.Config())
127 hiddenAPIAddStubLibDependencies(ctx, sdkKindToStubLibModules)
128}
129
Paul Duffin4994d262021-04-22 12:08:59 +0100130func (b *platformBootclasspathModule) BootclasspathDepsMutator(ctx android.BottomUpMutatorContext) {
131 // Add dependencies on all the modules configured in the "art" boot image.
132 artImageConfig := genBootImageConfigs(ctx)[artBootImageName]
Paul Duffin01b463b2021-04-26 20:05:39 +0100133 addDependenciesOntoBootImageModules(ctx, artImageConfig.modules, platformBootclasspathArtBootJarDepTag)
Paul Duffinb432df92021-03-22 22:09:42 +0000134
Paul Duffin01b463b2021-04-26 20:05:39 +0100135 // Add dependencies on all the non-updatable module configured in the "boot" boot image. That does
136 // not include modules configured in the "art" boot image.
Paul Duffin4994d262021-04-22 12:08:59 +0100137 bootImageConfig := b.getImageConfig(ctx)
Paul Duffin01b463b2021-04-26 20:05:39 +0100138 addDependenciesOntoBootImageModules(ctx, bootImageConfig.modules, platformBootclasspathNonUpdatableBootJarDepTag)
Paul Duffinb432df92021-03-22 22:09:42 +0000139
Paul Duffin4994d262021-04-22 12:08:59 +0100140 // Add dependencies on all the updatable modules.
141 updatableModules := dexpreopt.GetGlobalConfig(ctx).UpdatableBootJars
Paul Duffin01b463b2021-04-26 20:05:39 +0100142 addDependenciesOntoBootImageModules(ctx, updatableModules, platformBootclasspathUpdatableBootJarDepTag)
Paul Duffin62d8c3b2021-04-07 20:35:11 +0100143
Paul Duffin4994d262021-04-22 12:08:59 +0100144 // Add dependencies on all the fragments.
145 b.properties.BootclasspathFragmentsDepsProperties.addDependenciesOntoFragments(ctx)
Paul Duffinb432df92021-03-22 22:09:42 +0000146}
147
Paul Duffin01b463b2021-04-26 20:05:39 +0100148func addDependenciesOntoBootImageModules(ctx android.BottomUpMutatorContext, modules android.ConfiguredJarList, tag bootclasspathDependencyTag) {
Paul Duffinb432df92021-03-22 22:09:42 +0000149 for i := 0; i < modules.Len(); i++ {
150 apex := modules.Apex(i)
151 name := modules.Jar(i)
152
Paul Duffin01b463b2021-04-26 20:05:39 +0100153 addDependencyOntoApexModulePair(ctx, apex, name, tag)
Paul Duffinb432df92021-03-22 22:09:42 +0000154 }
155}
156
Paul Duffine3ecce62021-04-29 10:34:11 +0100157// GenerateSingletonBuildActions does nothing and must never do anything.
158//
159// This module only implements android.SingletonModule so that it can implement
160// android.SingletonMakeVarsProvider.
161func (b *platformBootclasspathModule) GenerateSingletonBuildActions(android.SingletonContext) {
162 // Keep empty
163}
164
165func (d *platformBootclasspathModule) MakeVars(ctx android.MakeVarsContext) {
Paul Duffin12d29b72021-04-29 13:50:01 +0100166 d.generateHiddenApiMakeVars(ctx)
Paul Duffine3ecce62021-04-29 10:34:11 +0100167}
168
Paul Duffinbb7f1ac2021-03-29 22:18:45 +0100169func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Artur Satayev97259dc2021-04-07 15:17:14 +0100170 b.classpathFragmentBase().generateAndroidBuildActions(ctx)
171
Paul Duffin01b463b2021-04-26 20:05:39 +0100172 // Gather all the dependencies from the art, updatable and non-updatable boot jars.
173 artModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathArtBootJarDepTag)
174 nonUpdatableModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathNonUpdatableBootJarDepTag)
175 updatableModules := gatherApexModulePairDepsWithTag(ctx, platformBootclasspathUpdatableBootJarDepTag)
176
177 // Concatenate them all, in order as they would appear on the bootclasspath.
178 var allModules []android.Module
179 allModules = append(allModules, artModules...)
180 allModules = append(allModules, nonUpdatableModules...)
181 allModules = append(allModules, updatableModules...)
182 b.configuredModules = allModules
183
184 // Gather all the fragments dependencies.
Paul Duffin9bacf562021-04-28 21:16:02 +0100185 b.fragments = gatherApexModulePairDepsWithTag(ctx, bootclasspathFragmentDepTag)
Paul Duffinb432df92021-03-22 22:09:42 +0000186
Paul Duffin9b381ef2021-04-08 23:01:37 +0100187 b.generateHiddenAPIBuildActions(ctx, b.configuredModules, b.fragments)
Paul Duffin702210b2021-04-08 20:12:41 +0100188
Paul Duffinbb7f1ac2021-03-29 22:18:45 +0100189 // Nothing to do if skipping the dexpreopt of boot image jars.
190 if SkipDexpreoptBootJars(ctx) {
191 return
192 }
193
Paul Duffin4c094422021-04-26 20:10:48 +0100194 b.generateBootImageBuildActions(ctx, updatableModules)
Paul Duffinbb7f1ac2021-03-29 22:18:45 +0100195}
196
197func (b *platformBootclasspathModule) getImageConfig(ctx android.EarlyModuleContext) *bootImageConfig {
198 return defaultBootImageConfig(ctx)
199}
Paul Duffin702210b2021-04-08 20:12:41 +0100200
Paul Duffind504c3a2021-04-30 08:10:21 +0100201// hiddenAPISupportingModule encapsulates the information provided by any module that contributes to
202// the hidden API processing.
203type hiddenAPISupportingModule struct {
204 module android.Module
205
206 bootDexJar android.Path
207 flagsCSV android.Path
208 indexCSV android.Path
209 metadataCSV android.Path
210}
211
Paul Duffin702210b2021-04-08 20:12:41 +0100212// generateHiddenAPIBuildActions generates all the hidden API related build rules.
Paul Duffin9b381ef2021-04-08 23:01:37 +0100213func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.ModuleContext, modules []android.Module, fragments []android.Module) {
Paul Duffin702210b2021-04-08 20:12:41 +0100214
Paul Duffin90b8ad32021-04-13 12:25:01 +0100215 // Save the paths to the monolithic files for retrieval via OutputFiles().
216 b.hiddenAPIFlagsCSV = hiddenAPISingletonPaths(ctx).flags
217 b.hiddenAPIIndexCSV = hiddenAPISingletonPaths(ctx).index
218 b.hiddenAPIMetadataCSV = hiddenAPISingletonPaths(ctx).metadata
Paul Duffin6a766452021-04-12 14:15:22 +0100219
Paul Duffin0b659862021-04-13 13:02:29 +0100220 // Don't run any hiddenapi rules if UNSAFE_DISABLE_HIDDENAPI_FLAGS=true. This is a performance
221 // optimization that can be used to reduce the incremental build time but as its name suggests it
222 // can be unsafe to use, e.g. when the changes affect anything that goes on the bootclasspath.
Vishnu Nair0dbd02a2021-04-30 00:24:07 +0000223 if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
Paul Duffin0b659862021-04-13 13:02:29 +0100224 paths := android.OutputPaths{b.hiddenAPIFlagsCSV, b.hiddenAPIIndexCSV, b.hiddenAPIMetadataCSV}
225 for _, path := range paths {
226 ctx.Build(pctx, android.BuildParams{
227 Rule: android.Touch,
228 Output: path,
229 })
230 }
231 return
232 }
233
Paul Duffind504c3a2021-04-30 08:10:21 +0100234 // nilPathHandler will check the supplied path and if it is nil then it will either immediately
235 // report an error, or it will defer the error reporting until it is actually used, depending
236 // whether missing dependencies are allowed.
237 var nilPathHandler func(path android.Path, name string, module android.Module) android.Path
238 if ctx.Config().AllowMissingDependencies() {
239 nilPathHandler = func(path android.Path, name string, module android.Module) android.Path {
240 if path == nil {
241 outputPath := android.PathForModuleOut(ctx, "missing", module.Name(), name)
242 path = outputPath
243
244 // Create an error rule that pretends to create the output file but will actually fail if it
245 // is run.
246 ctx.Build(pctx, android.BuildParams{
247 Rule: android.ErrorRule,
248 Output: outputPath,
249 Args: map[string]string{
250 "error": fmt.Sprintf("missing hidden API file: %s for %s", name, module),
251 },
252 })
253 }
254 return path
255 }
256 } else {
257 nilPathHandler = func(path android.Path, name string, module android.Module) android.Path {
258 if path == nil {
259 ctx.ModuleErrorf("module %s does not provide a %s file", module, name)
260 }
261 return path
262 }
263 }
264
Paul Duffin1ba24672021-04-12 23:26:14 +0100265 hiddenAPISupportingModules := []hiddenAPISupportingModule{}
Paul Duffin702210b2021-04-08 20:12:41 +0100266 for _, module := range modules {
Paul Duffind504c3a2021-04-30 08:10:21 +0100267 if h, ok := module.(hiddenAPIIntf); ok {
268 hiddenAPISupportingModule := hiddenAPISupportingModule{
269 module: module,
270 bootDexJar: nilPathHandler(h.bootDexJar(), "bootDexJar", module),
271 flagsCSV: nilPathHandler(h.flagsCSV(), "flagsCSV", module),
272 indexCSV: nilPathHandler(h.indexCSV(), "indexCSV", module),
273 metadataCSV: nilPathHandler(h.metadataCSV(), "metadataCSV", module),
Paul Duffin1ba24672021-04-12 23:26:14 +0100274 }
275
Paul Duffind504c3a2021-04-30 08:10:21 +0100276 // If any errors were reported when trying to populate the hiddenAPISupportingModule struct
277 // then don't add it to the list.
Paul Duffin1ba24672021-04-12 23:26:14 +0100278 if ctx.Failed() {
279 continue
280 }
281
Paul Duffind504c3a2021-04-30 08:10:21 +0100282 hiddenAPISupportingModules = append(hiddenAPISupportingModules, hiddenAPISupportingModule)
Paul Duffin702210b2021-04-08 20:12:41 +0100283 } else {
Paul Duffin1ba24672021-04-12 23:26:14 +0100284 ctx.ModuleErrorf("module %s of type %s does not support hidden API processing", module, ctx.OtherModuleType(module))
Paul Duffin702210b2021-04-08 20:12:41 +0100285 }
286 }
287
Paul Duffin1ba24672021-04-12 23:26:14 +0100288 moduleSpecificFlagsPaths := android.Paths{}
289 for _, module := range hiddenAPISupportingModules {
Paul Duffind504c3a2021-04-30 08:10:21 +0100290 moduleSpecificFlagsPaths = append(moduleSpecificFlagsPaths, module.flagsCSV)
Paul Duffin1ba24672021-04-12 23:26:14 +0100291 }
292
Paul Duffin9b381ef2021-04-08 23:01:37 +0100293 flagFileInfo := b.properties.Hidden_api.hiddenAPIFlagFileInfo(ctx)
294 for _, fragment := range fragments {
295 if ctx.OtherModuleHasProvider(fragment, hiddenAPIFlagFileInfoProvider) {
296 info := ctx.OtherModuleProvider(fragment, hiddenAPIFlagFileInfoProvider).(hiddenAPIFlagFileInfo)
297 flagFileInfo.append(info)
298 }
299 }
300
301 // Store the information for testing.
302 ctx.SetProvider(hiddenAPIFlagFileInfoProvider, flagFileInfo)
Paul Duffin702210b2021-04-08 20:12:41 +0100303
304 outputPath := hiddenAPISingletonPaths(ctx).flags
305 baseFlagsPath := hiddenAPISingletonPaths(ctx).stubFlags
Paul Duffin9b381ef2021-04-08 23:01:37 +0100306 ruleToGenerateHiddenApiFlags(ctx, outputPath, baseFlagsPath, moduleSpecificFlagsPaths, flagFileInfo)
Paul Duffin00b2bfd2021-04-12 17:24:36 +0100307
Paul Duffin74431d52021-04-21 14:10:42 +0100308 b.generateHiddenAPIStubFlagsRules(ctx, hiddenAPISupportingModules)
Paul Duffin00b2bfd2021-04-12 17:24:36 +0100309 b.generateHiddenAPIIndexRules(ctx, hiddenAPISupportingModules)
Paul Duffin85dee5d2021-04-13 00:14:38 +0100310 b.generatedHiddenAPIMetadataRules(ctx, hiddenAPISupportingModules)
Paul Duffin00b2bfd2021-04-12 17:24:36 +0100311}
312
Paul Duffin74431d52021-04-21 14:10:42 +0100313func (b *platformBootclasspathModule) generateHiddenAPIStubFlagsRules(ctx android.ModuleContext, modules []hiddenAPISupportingModule) {
314 bootDexJars := android.Paths{}
315 for _, module := range modules {
Paul Duffind504c3a2021-04-30 08:10:21 +0100316 bootDexJars = append(bootDexJars, module.bootDexJar)
Paul Duffin74431d52021-04-21 14:10:42 +0100317 }
318
319 sdkKindToStubPaths := hiddenAPIGatherStubLibDexJarPaths(ctx)
320
321 outputPath := hiddenAPISingletonPaths(ctx).stubFlags
322 rule := ruleToGenerateHiddenAPIStubFlagsFile(ctx, outputPath, bootDexJars, sdkKindToStubPaths)
323 rule.Build("platform-bootclasspath-monolithic-hiddenapi-stub-flags", "monolithic hidden API stub flags")
324}
325
Paul Duffin00b2bfd2021-04-12 17:24:36 +0100326func (b *platformBootclasspathModule) generateHiddenAPIIndexRules(ctx android.ModuleContext, modules []hiddenAPISupportingModule) {
327 indexes := android.Paths{}
328 for _, module := range modules {
Paul Duffind504c3a2021-04-30 08:10:21 +0100329 indexes = append(indexes, module.indexCSV)
Paul Duffin00b2bfd2021-04-12 17:24:36 +0100330 }
331
332 rule := android.NewRuleBuilder(pctx, ctx)
333 rule.Command().
334 BuiltTool("merge_csv").
335 Flag("--key_field signature").
336 FlagWithArg("--header=", "signature,file,startline,startcol,endline,endcol,properties").
337 FlagWithOutput("--output=", hiddenAPISingletonPaths(ctx).index).
338 Inputs(indexes)
339 rule.Build("platform-bootclasspath-monolithic-hiddenapi-index", "monolithic hidden API index")
Paul Duffin702210b2021-04-08 20:12:41 +0100340}
Paul Duffin85dee5d2021-04-13 00:14:38 +0100341
342func (b *platformBootclasspathModule) generatedHiddenAPIMetadataRules(ctx android.ModuleContext, modules []hiddenAPISupportingModule) {
343 metadataCSVFiles := android.Paths{}
344 for _, module := range modules {
Paul Duffind504c3a2021-04-30 08:10:21 +0100345 metadataCSVFiles = append(metadataCSVFiles, module.metadataCSV)
Paul Duffin85dee5d2021-04-13 00:14:38 +0100346 }
347
348 rule := android.NewRuleBuilder(pctx, ctx)
349
350 outputPath := hiddenAPISingletonPaths(ctx).metadata
351
352 rule.Command().
353 BuiltTool("merge_csv").
354 Flag("--key_field signature").
355 FlagWithOutput("--output=", outputPath).
356 Inputs(metadataCSVFiles)
357
358 rule.Build("platform-bootclasspath-monolithic-hiddenapi-metadata", "monolithic hidden API metadata")
359}
Paul Duffinad19d382021-04-26 16:44:00 +0100360
Paul Duffin12d29b72021-04-29 13:50:01 +0100361// generateHiddenApiMakeVars generates make variables needed by hidden API related make rules, e.g.
362// veridex and run-appcompat.
363func (b *platformBootclasspathModule) generateHiddenApiMakeVars(ctx android.MakeVarsContext) {
364 if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
365 return
366 }
367 // INTERNAL_PLATFORM_HIDDENAPI_FLAGS is used by Make rules in art/ and cts/.
368 ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_FLAGS", b.hiddenAPIFlagsCSV.String())
369}
370
Paul Duffinad19d382021-04-26 16:44:00 +0100371// generateBootImageBuildActions generates ninja rules related to the boot image creation.
Paul Duffin4c094422021-04-26 20:10:48 +0100372func (b *platformBootclasspathModule) generateBootImageBuildActions(ctx android.ModuleContext, updatableModules []android.Module) {
Paul Duffinad19d382021-04-26 16:44:00 +0100373 // Force the GlobalSoongConfig to be created and cached for use by the dex_bootjars
374 // GenerateSingletonBuildActions method as it cannot create it for itself.
375 dexpreopt.GetGlobalSoongConfig(ctx)
376
377 imageConfig := b.getImageConfig(ctx)
378 if imageConfig == nil {
379 return
380 }
381
382 global := dexpreopt.GetGlobalConfig(ctx)
383 if !shouldBuildBootImages(ctx.Config(), global) {
384 return
385 }
386
387 // Generate the framework profile rule
388 bootFrameworkProfileRule(ctx, imageConfig)
Paul Duffin4c094422021-04-26 20:10:48 +0100389
390 // Generate the updatable bootclasspath packages rule.
391 generateUpdatableBcpPackagesRule(ctx, imageConfig, updatableModules)
Paul Duffinf7a55922021-04-26 23:09:15 +0100392
393 dumpOatRules(ctx, imageConfig)
Paul Duffinad19d382021-04-26 16:44:00 +0100394}