blob: 10648016c66af4a38660013222d64cf257211d77 [file] [log] [blame]
Paul Duffin3451e162021-01-20 15:16:56 +00001// Copyright (C) 2021 The Android Open Source Project
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 Duffina1d60252021-01-21 18:13:43 +000018 "fmt"
Paul Duffin7c955552021-04-19 13:23:53 +010019 "path/filepath"
Paul Duffinba6afd02019-11-19 19:44:10 +000020 "reflect"
Paul Duffin3451e162021-01-20 15:16:56 +000021 "strings"
22
23 "android/soong/android"
Paul Duffina1d60252021-01-21 18:13:43 +000024 "android/soong/dexpreopt"
Paul Duffinc7ef9892021-03-23 23:21:59 +000025 "github.com/google/blueprint/proptools"
Martin Stjernholmb79c7f12021-03-17 00:26:25 +000026
Paul Duffin3451e162021-01-20 15:16:56 +000027 "github.com/google/blueprint"
28)
29
30func init() {
Paul Duffin7771eba2021-04-23 14:25:28 +010031 registerBootclasspathFragmentBuildComponents(android.InitRegistrationContext)
Paul Duffinf7f65da2021-03-10 15:00:46 +000032
Paul Duffin7771eba2021-04-23 14:25:28 +010033 android.RegisterSdkMemberType(&bootclasspathFragmentMemberType{
Paul Duffin4b64ba02021-03-29 11:02:53 +010034 SdkMemberTypeBase: android.SdkMemberTypeBase{
Paul Duffin2d3da312021-05-06 12:02:27 +010035 PropertyName: "bootclasspath_fragments",
36 SupportsSdk: true,
Paul Duffin4b64ba02021-03-29 11:02:53 +010037 },
38 })
Paul Duffin3451e162021-01-20 15:16:56 +000039}
40
Paul Duffin7771eba2021-04-23 14:25:28 +010041func registerBootclasspathFragmentBuildComponents(ctx android.RegistrationContext) {
Paul Duffin7771eba2021-04-23 14:25:28 +010042 ctx.RegisterModuleType("bootclasspath_fragment", bootclasspathFragmentFactory)
43 ctx.RegisterModuleType("prebuilt_bootclasspath_fragment", prebuiltBootclasspathFragmentFactory)
Paul Duffin3451e162021-01-20 15:16:56 +000044}
45
Paul Duffin65898052021-04-20 22:47:03 +010046type bootclasspathFragmentContentDependencyTag struct {
Paul Duffinc7ef9892021-03-23 23:21:59 +000047 blueprint.BaseDependencyTag
48}
49
Paul Duffin7771eba2021-04-23 14:25:28 +010050// Avoid having to make bootclasspath_fragment content visible to the bootclasspath_fragment.
Paul Duffinc7ef9892021-03-23 23:21:59 +000051//
Paul Duffin7771eba2021-04-23 14:25:28 +010052// This is a temporary workaround to make it easier to migrate to bootclasspath_fragment modules
53// with proper dependencies.
Paul Duffinc7ef9892021-03-23 23:21:59 +000054// TODO(b/177892522): Remove this and add needed visibility.
Paul Duffin65898052021-04-20 22:47:03 +010055func (b bootclasspathFragmentContentDependencyTag) ExcludeFromVisibilityEnforcement() {
56}
57
58// The bootclasspath_fragment contents must never depend on prebuilts.
59func (b bootclasspathFragmentContentDependencyTag) ReplaceSourceWithPrebuilt() bool {
60 return false
Paul Duffinc7ef9892021-03-23 23:21:59 +000061}
62
Paul Duffine95b53a2021-04-23 20:41:23 +010063// SdkMemberType causes dependencies added with this tag to be automatically added to the sdk as if
Paul Duffina10bd3c2021-05-12 13:46:54 +010064// they were specified using java_boot_libs or java_sdk_libs.
65func (b bootclasspathFragmentContentDependencyTag) SdkMemberType(child android.Module) android.SdkMemberType {
66 // If the module is a java_sdk_library then treat it as if it was specified in the java_sdk_libs
67 // property, otherwise treat if it was specified in the java_boot_libs property.
68 if javaSdkLibrarySdkMemberType.IsInstance(child) {
69 return javaSdkLibrarySdkMemberType
70 }
71
Paul Duffine95b53a2021-04-23 20:41:23 +010072 return javaBootLibsSdkMemberType
73}
74
75func (b bootclasspathFragmentContentDependencyTag) ExportMember() bool {
76 return true
77}
78
Paul Duffin7771eba2021-04-23 14:25:28 +010079// The tag used for the dependency between the bootclasspath_fragment module and its contents.
Paul Duffin65898052021-04-20 22:47:03 +010080var bootclasspathFragmentContentDepTag = bootclasspathFragmentContentDependencyTag{}
Paul Duffinc7ef9892021-03-23 23:21:59 +000081
Paul Duffin65898052021-04-20 22:47:03 +010082var _ android.ExcludeFromVisibilityEnforcementTag = bootclasspathFragmentContentDepTag
83var _ android.ReplaceSourceWithPrebuilt = bootclasspathFragmentContentDepTag
Paul Duffine95b53a2021-04-23 20:41:23 +010084var _ android.SdkMemberTypeDependencyTag = bootclasspathFragmentContentDepTag
Paul Duffinc7ef9892021-03-23 23:21:59 +000085
Paul Duffin65898052021-04-20 22:47:03 +010086func IsBootclasspathFragmentContentDepTag(tag blueprint.DependencyTag) bool {
87 return tag == bootclasspathFragmentContentDepTag
Paul Duffin4d101b62021-03-24 15:42:20 +000088}
89
Paul Duffinc7d16442021-04-23 13:55:49 +010090// Properties that can be different when coverage is enabled.
91type BootclasspathFragmentCoverageAffectedProperties struct {
92 // The contents of this bootclasspath_fragment, could be either java_library, or java_sdk_library.
93 //
Paul Duffin34827d42021-05-13 21:25:05 +010094 // A java_sdk_library specified here will also be treated as if it was specified on the stub_libs
95 // property.
96 //
Paul Duffinc7d16442021-04-23 13:55:49 +010097 // The order of this list matters as it is the order that is used in the bootclasspath.
98 Contents []string
Paul Duffin10931582021-04-25 10:13:54 +010099
100 // The properties for specifying the API stubs provided by this fragment.
101 BootclasspathAPIProperties
Paul Duffinc7d16442021-04-23 13:55:49 +0100102}
103
Paul Duffin7771eba2021-04-23 14:25:28 +0100104type bootclasspathFragmentProperties struct {
Paul Duffin3451e162021-01-20 15:16:56 +0000105 // The name of the image this represents.
106 //
Paul Duffin82886d62021-03-24 01:34:57 +0000107 // If specified then it must be one of "art" or "boot".
Paul Duffin64be7bb2021-03-23 23:06:38 +0000108 Image_name *string
Paul Duffinc7ef9892021-03-23 23:21:59 +0000109
Paul Duffinc7d16442021-04-23 13:55:49 +0100110 // Properties whose values need to differ with and without coverage.
111 BootclasspathFragmentCoverageAffectedProperties
112 Coverage BootclasspathFragmentCoverageAffectedProperties
Paul Duffin9b381ef2021-04-08 23:01:37 +0100113
114 Hidden_api HiddenAPIFlagFileProperties
Paul Duffin460952c2021-05-15 09:10:42 +0100115
116 // Properties that allow a fragment to depend on other fragments. This is needed for hidden API
117 // processing as it needs access to all the classes used by a fragment including those provided
118 // by other fragments.
119 BootclasspathFragmentsDepsProperties
Paul Duffin3451e162021-01-20 15:16:56 +0000120}
121
Paul Duffin7771eba2021-04-23 14:25:28 +0100122type BootclasspathFragmentModule struct {
Paul Duffin3451e162021-01-20 15:16:56 +0000123 android.ModuleBase
Paul Duffina1d60252021-01-21 18:13:43 +0000124 android.ApexModuleBase
Paul Duffinf7f65da2021-03-10 15:00:46 +0000125 android.SdkBase
satayev3db35472021-05-06 23:59:58 +0100126 ClasspathFragmentBase
127
Paul Duffin7771eba2021-04-23 14:25:28 +0100128 properties bootclasspathFragmentProperties
Paul Duffin3451e162021-01-20 15:16:56 +0000129}
130
Paul Duffin2fef1362021-04-15 13:32:00 +0100131// commonBootclasspathFragment defines the methods that are implemented by both source and prebuilt
132// bootclasspath fragment modules.
133type commonBootclasspathFragment interface {
134 // produceHiddenAPIAllFlagsFile produces the all-flags.csv and intermediate files.
135 //
136 // Updates the supplied flagFileInfo with the paths to the generated files set.
Paul Duffin537ea3d2021-05-14 10:38:00 +0100137 produceHiddenAPIAllFlagsFile(ctx android.ModuleContext, contents []hiddenAPIModule, stubJarsByKind map[android.SdkKind]android.Paths, flagFileInfo *hiddenAPIFlagFileInfo)
Paul Duffin2fef1362021-04-15 13:32:00 +0100138}
139
Paul Duffin7771eba2021-04-23 14:25:28 +0100140func bootclasspathFragmentFactory() android.Module {
141 m := &BootclasspathFragmentModule{}
Paul Duffin3451e162021-01-20 15:16:56 +0000142 m.AddProperties(&m.properties)
Paul Duffina1d60252021-01-21 18:13:43 +0000143 android.InitApexModule(m)
Paul Duffinf7f65da2021-03-10 15:00:46 +0000144 android.InitSdkAwareModule(m)
satayev3db35472021-05-06 23:59:58 +0100145 initClasspathFragment(m, BOOTCLASSPATH)
Martin Stjernholmb79c7f12021-03-17 00:26:25 +0000146 android.InitAndroidArchModule(m, android.HostAndDeviceSupported, android.MultilibCommon)
Paul Duffinc7ef9892021-03-23 23:21:59 +0000147
Paul Duffinc7ef9892021-03-23 23:21:59 +0000148 android.AddLoadHook(m, func(ctx android.LoadHookContext) {
Paul Duffinc7d16442021-04-23 13:55:49 +0100149 // If code coverage has been enabled for the framework then append the properties with
150 // coverage specific properties.
151 if ctx.Config().IsEnvTrue("EMMA_INSTRUMENT_FRAMEWORK") {
152 err := proptools.AppendProperties(&m.properties.BootclasspathFragmentCoverageAffectedProperties, &m.properties.Coverage, nil)
153 if err != nil {
154 ctx.PropertyErrorf("coverage", "error trying to append coverage specific properties: %s", err)
155 return
156 }
157 }
158
159 // Initialize the contents property from the image_name.
Paul Duffin7771eba2021-04-23 14:25:28 +0100160 bootclasspathFragmentInitContentsFromImage(ctx, m)
Paul Duffinc7ef9892021-03-23 23:21:59 +0000161 })
Paul Duffin3451e162021-01-20 15:16:56 +0000162 return m
163}
164
Paul Duffin7771eba2021-04-23 14:25:28 +0100165// bootclasspathFragmentInitContentsFromImage will initialize the contents property from the image_name if
166// necessary.
167func bootclasspathFragmentInitContentsFromImage(ctx android.EarlyModuleContext, m *BootclasspathFragmentModule) {
Paul Duffin82886d62021-03-24 01:34:57 +0000168 contents := m.properties.Contents
169 if m.properties.Image_name == nil && len(contents) == 0 {
170 ctx.ModuleErrorf(`neither of the "image_name" and "contents" properties have been supplied, please supply exactly one`)
171 }
Paul Duffinba6afd02019-11-19 19:44:10 +0000172
Paul Duffinc7ef9892021-03-23 23:21:59 +0000173 imageName := proptools.String(m.properties.Image_name)
174 if imageName == "art" {
Paul Duffin023dba02021-04-22 01:45:29 +0100175 // TODO(b/177892522): Prebuilts (versioned or not) should not use the image_name property.
Paul Duffin0c2e0832021-04-28 00:39:52 +0100176 if android.IsModuleInVersionedSdk(m) {
Paul Duffin023dba02021-04-22 01:45:29 +0100177 // The module is a versioned prebuilt so ignore it. This is done for a couple of reasons:
178 // 1. There is no way to use this at the moment so ignoring it is safe.
179 // 2. Attempting to initialize the contents property from the configuration will end up having
180 // the versioned prebuilt depending on the unversioned prebuilt. That will cause problems
181 // as the unversioned prebuilt could end up with an APEX variant created for the source
182 // APEX which will prevent it from having an APEX variant for the prebuilt APEX which in
183 // turn will prevent it from accessing the dex implementation jar from that which will
184 // break hidden API processing, amongst others.
185 return
186 }
187
Paul Duffinc7ef9892021-03-23 23:21:59 +0000188 // Get the configuration for the art apex jars. Do not use getImageConfig(ctx) here as this is
189 // too early in the Soong processing for that to work.
190 global := dexpreopt.GetGlobalConfig(ctx)
191 modules := global.ArtApexJars
192
193 // Make sure that the apex specified in the configuration is consistent and is one for which
194 // this boot image is available.
Paul Duffinc7ef9892021-03-23 23:21:59 +0000195 commonApex := ""
196 for i := 0; i < modules.Len(); i++ {
197 apex := modules.Apex(i)
198 jar := modules.Jar(i)
199 if apex == "platform" {
200 ctx.ModuleErrorf("ArtApexJars is invalid as it requests a platform variant of %q", jar)
201 continue
202 }
203 if !m.AvailableFor(apex) {
Paul Duffinf23bc472021-04-27 12:42:20 +0100204 ctx.ModuleErrorf("ArtApexJars configuration incompatible with this module, ArtApexJars expects this to be in apex %q but this is only in apexes %q",
Paul Duffinc7ef9892021-03-23 23:21:59 +0000205 apex, m.ApexAvailable())
206 continue
207 }
208 if commonApex == "" {
209 commonApex = apex
210 } else if commonApex != apex {
211 ctx.ModuleErrorf("ArtApexJars configuration is inconsistent, expected all jars to be in the same apex but it specifies apex %q and %q",
212 commonApex, apex)
213 }
Paul Duffinc7ef9892021-03-23 23:21:59 +0000214 }
215
Paul Duffinf23bc472021-04-27 12:42:20 +0100216 if len(contents) != 0 {
217 // Nothing to do.
218 return
219 }
220
Paul Duffinc7ef9892021-03-23 23:21:59 +0000221 // Store the jars in the Contents property so that they can be used to add dependencies.
Paul Duffinba6afd02019-11-19 19:44:10 +0000222 m.properties.Contents = modules.CopyOfJars()
223 }
224}
225
226// bootclasspathImageNameContentsConsistencyCheck checks that the configuration that applies to this
227// module (if any) matches the contents.
228//
229// This should be a noop as if image_name="art" then the contents will be set from the ArtApexJars
230// config by bootclasspathFragmentInitContentsFromImage so it will be guaranteed to match. However,
231// in future this will not be the case.
232func (b *BootclasspathFragmentModule) bootclasspathImageNameContentsConsistencyCheck(ctx android.BaseModuleContext) {
233 imageName := proptools.String(b.properties.Image_name)
234 if imageName == "art" {
235 // TODO(b/177892522): Prebuilts (versioned or not) should not use the image_name property.
Paul Duffin0c2e0832021-04-28 00:39:52 +0100236 if android.IsModuleInVersionedSdk(b) {
Paul Duffinba6afd02019-11-19 19:44:10 +0000237 // The module is a versioned prebuilt so ignore it. This is done for a couple of reasons:
238 // 1. There is no way to use this at the moment so ignoring it is safe.
239 // 2. Attempting to initialize the contents property from the configuration will end up having
240 // the versioned prebuilt depending on the unversioned prebuilt. That will cause problems
241 // as the unversioned prebuilt could end up with an APEX variant created for the source
242 // APEX which will prevent it from having an APEX variant for the prebuilt APEX which in
243 // turn will prevent it from accessing the dex implementation jar from that which will
244 // break hidden API processing, amongst others.
245 return
246 }
247
248 // Get the configuration for the art apex jars.
249 modules := b.getImageConfig(ctx).modules
250 configuredJars := modules.CopyOfJars()
251
252 // Skip the check if the configured jars list is empty as that is a common configuration when
253 // building targets that do not result in a system image.
254 if len(configuredJars) == 0 {
255 return
256 }
257
258 contents := b.properties.Contents
259 if !reflect.DeepEqual(configuredJars, contents) {
260 ctx.ModuleErrorf("inconsistency in specification of contents. ArtApexJars configuration specifies %#v, contents property specifies %#v",
261 configuredJars, contents)
262 }
Paul Duffinc7ef9892021-03-23 23:21:59 +0000263 }
264}
265
Paul Duffine946b322021-04-25 23:04:00 +0100266var BootclasspathFragmentApexContentInfoProvider = blueprint.NewProvider(BootclasspathFragmentApexContentInfo{})
Paul Duffin3451e162021-01-20 15:16:56 +0000267
Paul Duffine946b322021-04-25 23:04:00 +0100268// BootclasspathFragmentApexContentInfo contains the bootclasspath_fragments contributions to the
269// apex contents.
270type BootclasspathFragmentApexContentInfo struct {
Paul Duffin3451e162021-01-20 15:16:56 +0000271 // The image config, internal to this module (and the dex_bootjars singleton).
Paul Duffina1d60252021-01-21 18:13:43 +0000272 //
Paul Duffine946b322021-04-25 23:04:00 +0100273 // Will be nil if the BootclasspathFragmentApexContentInfo has not been provided for a specific module. That can occur
Paul Duffina1d60252021-01-21 18:13:43 +0000274 // when SkipDexpreoptBootJars(ctx) returns true.
Paul Duffin3451e162021-01-20 15:16:56 +0000275 imageConfig *bootImageConfig
276}
277
Paul Duffine946b322021-04-25 23:04:00 +0100278func (i BootclasspathFragmentApexContentInfo) Modules() android.ConfiguredJarList {
Paul Duffin3451e162021-01-20 15:16:56 +0000279 return i.imageConfig.modules
280}
281
Paul Duffina1d60252021-01-21 18:13:43 +0000282// Get a map from ArchType to the associated boot image's contents for Android.
283//
284// Extension boot images only return their own files, not the files of the boot images they extend.
Paul Duffine946b322021-04-25 23:04:00 +0100285func (i BootclasspathFragmentApexContentInfo) AndroidBootImageFilesByArchType() map[android.ArchType]android.OutputPaths {
Paul Duffina1d60252021-01-21 18:13:43 +0000286 files := map[android.ArchType]android.OutputPaths{}
287 if i.imageConfig != nil {
288 for _, variant := range i.imageConfig.variants {
289 // We also generate boot images for host (for testing), but we don't need those in the apex.
290 // TODO(b/177892522) - consider changing this to check Os.OsClass = android.Device
291 if variant.target.Os == android.Android {
292 files[variant.target.Arch.ArchType] = variant.imagesDeps
293 }
294 }
295 }
296 return files
297}
298
Paul Duffin190fdef2021-04-26 10:33:59 +0100299// DexBootJarPathForContentModule returns the path to the dex boot jar for specified module.
300//
301// The dex boot jar is one which has had hidden API encoding performed on it.
302func (i BootclasspathFragmentApexContentInfo) DexBootJarPathForContentModule(module android.Module) android.Path {
303 j := module.(UsesLibraryDependency)
304 dexJar := j.DexJarBuildPath()
305 return dexJar
306}
307
Paul Duffin7771eba2021-04-23 14:25:28 +0100308func (b *BootclasspathFragmentModule) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
Paul Duffina1d60252021-01-21 18:13:43 +0000309 tag := ctx.OtherModuleDependencyTag(dep)
Paul Duffin65898052021-04-20 22:47:03 +0100310 if IsBootclasspathFragmentContentDepTag(tag) {
Paul Duffin4d101b62021-03-24 15:42:20 +0000311 // Boot image contents are automatically added to apex.
312 return true
Paul Duffinc7ef9892021-03-23 23:21:59 +0000313 }
Bob Badour07065cd2021-02-05 19:59:11 -0800314 if android.IsMetaDependencyTag(tag) {
315 // Cross-cutting metadata dependencies are metadata.
316 return false
317 }
Paul Duffina1d60252021-01-21 18:13:43 +0000318 panic(fmt.Errorf("boot_image module %q should not have a dependency on %q via tag %s", b, dep, android.PrettyPrintTag(tag)))
319}
320
Paul Duffin7771eba2021-04-23 14:25:28 +0100321func (b *BootclasspathFragmentModule) ShouldSupportSdkVersion(ctx android.BaseModuleContext, sdkVersion android.ApiLevel) error {
Paul Duffina1d60252021-01-21 18:13:43 +0000322 return nil
323}
324
Paul Duffin65898052021-04-20 22:47:03 +0100325// ComponentDepsMutator adds dependencies onto modules before any prebuilt modules without a
326// corresponding source module are renamed. This means that adding a dependency using a name without
327// a prebuilt_ prefix will always resolve to a source module and when using a name with that prefix
328// it will always resolve to a prebuilt module.
Paul Duffin7771eba2021-04-23 14:25:28 +0100329func (b *BootclasspathFragmentModule) ComponentDepsMutator(ctx android.BottomUpMutatorContext) {
Paul Duffin65898052021-04-20 22:47:03 +0100330 module := ctx.Module()
Paul Duffin7771eba2021-04-23 14:25:28 +0100331 _, isSourceModule := module.(*BootclasspathFragmentModule)
Paul Duffin65898052021-04-20 22:47:03 +0100332
333 for _, name := range b.properties.Contents {
334 // A bootclasspath_fragment must depend only on other source modules, while the
335 // prebuilt_bootclasspath_fragment must only depend on other prebuilt modules.
Paul Duffina9dd6fa2021-04-22 17:25:57 +0100336 //
337 // TODO(b/177892522) - avoid special handling of jacocoagent.
338 if !isSourceModule && name != "jacocoagent" {
Paul Duffin65898052021-04-20 22:47:03 +0100339 name = android.PrebuiltNameFromSource(name)
340 }
341 ctx.AddDependency(module, bootclasspathFragmentContentDepTag, name)
342 }
343
344}
345
Paul Duffin7771eba2021-04-23 14:25:28 +0100346func (b *BootclasspathFragmentModule) DepsMutator(ctx android.BottomUpMutatorContext) {
Paul Duffin10931582021-04-25 10:13:54 +0100347 // Add dependencies onto all the modules that provide the API stubs for classes on this
348 // bootclasspath fragment.
349 hiddenAPIAddStubLibDependencies(ctx, b.properties.sdkKindToStubLibs())
Paul Duffinc7ef9892021-03-23 23:21:59 +0000350
Paul Duffina1d60252021-01-21 18:13:43 +0000351 if SkipDexpreoptBootJars(ctx) {
352 return
353 }
354
355 // Add a dependency onto the dex2oat tool which is needed for creating the boot image. The
356 // path is retrieved from the dependency by GetGlobalSoongConfig(ctx).
357 dexpreopt.RegisterToolDeps(ctx)
358}
359
Paul Duffin7771eba2021-04-23 14:25:28 +0100360func (b *BootclasspathFragmentModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Paul Duffinba6afd02019-11-19 19:44:10 +0000361 // Only perform a consistency check if this module is the active module. That will prevent an
362 // unused prebuilt that was created without instrumentation from breaking an instrumentation
363 // build.
364 if isActiveModule(ctx.Module()) {
365 b.bootclasspathImageNameContentsConsistencyCheck(ctx)
366 }
367
satayev3db35472021-05-06 23:59:58 +0100368 // Generate classpaths.proto config
369 b.generateClasspathProtoBuildActions(ctx)
370
Paul Duffin7ebebfd2021-04-27 19:36:57 +0100371 // Gather the bootclasspath fragment's contents.
372 var contents []android.Module
373 ctx.VisitDirectDeps(func(module android.Module) {
374 tag := ctx.OtherModuleDependencyTag(module)
375 if IsBootclasspathFragmentContentDepTag(tag) {
Paul Duffin79fd3d72021-05-14 16:14:17 +0100376 contents = append(contents, module)
Paul Duffin7ebebfd2021-04-27 19:36:57 +0100377 }
378 })
379
Paul Duffin9b381ef2021-04-08 23:01:37 +0100380 // Perform hidden API processing.
Paul Duffin2fef1362021-04-15 13:32:00 +0100381 b.generateHiddenAPIBuildActions(ctx, contents)
Paul Duffin9b381ef2021-04-08 23:01:37 +0100382
satayev3db35472021-05-06 23:59:58 +0100383 if !SkipDexpreoptBootJars(ctx) {
384 // Force the GlobalSoongConfig to be created and cached for use by the dex_bootjars
385 // GenerateSingletonBuildActions method as it cannot create it for itself.
386 dexpreopt.GetGlobalSoongConfig(ctx)
Paul Duffin7ebebfd2021-04-27 19:36:57 +0100387
388 // Only generate the boot image if the configuration does not skip it.
389 b.generateBootImageBuildActions(ctx, contents)
Paul Duffin3451e162021-01-20 15:16:56 +0000390
satayev72ede0f2021-05-17 21:03:07 +0100391 // Make the boot image info available for other modules
392 ctx.SetProvider(BootclasspathFragmentApexContentInfoProvider, BootclasspathFragmentApexContentInfo{
393 imageConfig: b.getImageConfig(ctx),
394 })
395 }
Paul Duffin3451e162021-01-20 15:16:56 +0000396}
Paul Duffinf7f65da2021-03-10 15:00:46 +0000397
satayev3db35472021-05-06 23:59:58 +0100398// generateClasspathProtoBuildActions generates all required build actions for classpath.proto config
399func (b *BootclasspathFragmentModule) generateClasspathProtoBuildActions(ctx android.ModuleContext) {
400 var classpathJars []classpathJar
401 if "art" == proptools.String(b.properties.Image_name) {
402 // ART and platform boot jars must have a corresponding entry in DEX2OATBOOTCLASSPATH
403 classpathJars = configuredJarListToClasspathJars(ctx, b.ClasspathFragmentToConfiguredJarList(ctx), BOOTCLASSPATH, DEX2OATBOOTCLASSPATH)
404 } else {
405 classpathJars = configuredJarListToClasspathJars(ctx, b.ClasspathFragmentToConfiguredJarList(ctx), b.classpathType)
406 }
407 b.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, classpathJars)
408}
409
410func (b *BootclasspathFragmentModule) ClasspathFragmentToConfiguredJarList(ctx android.ModuleContext) android.ConfiguredJarList {
satayev95bfbb12021-05-20 11:24:00 +0100411 if "art" == proptools.String(b.properties.Image_name) {
412 return b.getImageConfig(ctx).modules
413 }
414
415 global := dexpreopt.GetGlobalConfig(ctx)
416
417 // Only create configs for updatable boot jars. Non-updatable boot jars must be part of the
418 // platform_bootclasspath's classpath proto config to guarantee that they come before any
419 // updatable jars at runtime.
420 return global.UpdatableBootJars.Filter(b.properties.Contents)
satayev3db35472021-05-06 23:59:58 +0100421}
422
Paul Duffin7771eba2021-04-23 14:25:28 +0100423func (b *BootclasspathFragmentModule) getImageConfig(ctx android.EarlyModuleContext) *bootImageConfig {
Paul Duffin64be7bb2021-03-23 23:06:38 +0000424 // Get a map of the image configs that are supported.
425 imageConfigs := genBootImageConfigs(ctx)
426
427 // Retrieve the config for this image.
428 imageNamePtr := b.properties.Image_name
429 if imageNamePtr == nil {
430 return nil
431 }
432
433 imageName := *imageNamePtr
434 imageConfig := imageConfigs[imageName]
435 if imageConfig == nil {
436 ctx.PropertyErrorf("image_name", "Unknown image name %q, expected one of %s", imageName, strings.Join(android.SortedStringKeys(imageConfigs), ", "))
437 return nil
438 }
439 return imageConfig
440}
441
Paul Duffin460952c2021-05-15 09:10:42 +0100442// canPerformHiddenAPIProcessing determines whether hidden API processing should be performed.
443//
444// A temporary workaround to avoid existing bootclasspath_fragments that do not provide the
445// appropriate information needed for hidden API processing breaking the build.
446// TODO(b/179354495): Remove this workaround.
447func (b *BootclasspathFragmentModule) canPerformHiddenAPIProcessing(ctx android.ModuleContext) bool {
448 // Hidden API processing is always enabled in tests.
449 if ctx.Config().TestProductVariables != nil {
450 return true
451 }
452 // A module that has fragments should have access to the information it needs in order to perform
453 // hidden API processing.
454 if len(b.properties.Fragments) != 0 {
455 return true
456 }
457
458 // The art bootclasspath fragment does not depend on any other fragments but already supports
459 // hidden API processing.
460 imageName := proptools.String(b.properties.Image_name)
461 if imageName == "art" {
462 return true
463 }
464
465 // Disable it for everything else.
466 return false
467}
468
Paul Duffin9b381ef2021-04-08 23:01:37 +0100469// generateHiddenAPIBuildActions generates all the hidden API related build rules.
Paul Duffin2fef1362021-04-15 13:32:00 +0100470func (b *BootclasspathFragmentModule) generateHiddenAPIBuildActions(ctx android.ModuleContext, contents []android.Module) {
Paul Duffin10931582021-04-25 10:13:54 +0100471
Paul Duffin460952c2021-05-15 09:10:42 +0100472 // A temporary workaround to avoid existing bootclasspath_fragments that do not provide the
473 // appropriate information needed for hidden API processing breaking the build.
474 if !b.canPerformHiddenAPIProcessing(ctx) {
475 // Nothing to do.
476 return
477 }
478
Paul Duffin10931582021-04-25 10:13:54 +0100479 // Convert the kind specific lists of modules into kind specific lists of jars.
Paul Duffin34827d42021-05-13 21:25:05 +0100480 stubJarsByKind := hiddenAPIGatherStubLibDexJarPaths(ctx, contents)
Paul Duffin10931582021-04-25 10:13:54 +0100481
Paul Duffin460952c2021-05-15 09:10:42 +0100482 // Performing hidden API processing without stubs is not supported and it is unlikely to ever be
483 // required as the whole point of adding something to the bootclasspath fragment is to add it to
484 // the bootclasspath in order to be used by something else in the system. Without any stubs it
485 // cannot do that.
486 if len(stubJarsByKind) == 0 {
487 return
488 }
489
Paul Duffin10931582021-04-25 10:13:54 +0100490 // Store the information for use by other modules.
491 bootclasspathApiInfo := bootclasspathApiInfo{stubJarsByKind: stubJarsByKind}
492 ctx.SetProvider(bootclasspathApiInfoProvider, bootclasspathApiInfo)
Paul Duffin2fef1362021-04-15 13:32:00 +0100493
494 // Resolve the properties to paths.
495 flagFileInfo := b.properties.Hidden_api.hiddenAPIFlagFileInfo(ctx)
496
Paul Duffin537ea3d2021-05-14 10:38:00 +0100497 hiddenAPIModules := gatherHiddenAPIModuleFromContents(ctx, contents)
498
Paul Duffin2fef1362021-04-15 13:32:00 +0100499 // Delegate the production of the hidden API all flags file to a module type specific method.
500 common := ctx.Module().(commonBootclasspathFragment)
Paul Duffin537ea3d2021-05-14 10:38:00 +0100501 common.produceHiddenAPIAllFlagsFile(ctx, hiddenAPIModules, stubJarsByKind, &flagFileInfo)
Paul Duffin2fef1362021-04-15 13:32:00 +0100502
503 // Store the information for use by platform_bootclasspath.
504 ctx.SetProvider(hiddenAPIFlagFileInfoProvider, flagFileInfo)
505}
506
507// produceHiddenAPIAllFlagsFile produces the hidden API all-flags.csv file (and supporting files)
508// for the fragment.
Paul Duffin537ea3d2021-05-14 10:38:00 +0100509func (b *BootclasspathFragmentModule) produceHiddenAPIAllFlagsFile(ctx android.ModuleContext, contents []hiddenAPIModule, stubJarsByKind map[android.SdkKind]android.Paths, flagFileInfo *hiddenAPIFlagFileInfo) {
Paul Duffin2fef1362021-04-15 13:32:00 +0100510 // Generate the rules to create the hidden API flags and update the supplied flagFileInfo with the
511 // paths to the created files.
512 hiddenAPIGenerateAllFlagsForBootclasspathFragment(ctx, contents, stubJarsByKind, flagFileInfo)
Paul Duffin9b381ef2021-04-08 23:01:37 +0100513}
514
Paul Duffin7ebebfd2021-04-27 19:36:57 +0100515// generateBootImageBuildActions generates ninja rules to create the boot image if required for this
516// module.
517func (b *BootclasspathFragmentModule) generateBootImageBuildActions(ctx android.ModuleContext, contents []android.Module) {
518 global := dexpreopt.GetGlobalConfig(ctx)
519 if !shouldBuildBootImages(ctx.Config(), global) {
520 return
521 }
522
523 // Bootclasspath fragment modules that are not preferred do not produce a boot image.
524 if !isActiveModule(ctx.Module()) {
525 return
526 }
527
528 // Bootclasspath fragment modules that have no image_name property do not produce a boot image.
529 imageConfig := b.getImageConfig(ctx)
530 if imageConfig == nil {
531 return
532 }
533
534 // Bootclasspath fragment modules that are for the platform do not produce a boot image.
535 apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
536 if apexInfo.IsForPlatform() {
537 return
538 }
539
540 // Bootclasspath fragment modules that are versioned do not produce a boot image.
541 if android.IsModuleInVersionedSdk(ctx.Module()) {
542 return
543 }
544
545 // Copy the dex jars of this fragment's content modules to their predefined locations.
546 copyBootJarsToPredefinedLocations(ctx, contents, imageConfig.modules, imageConfig.dexPaths)
Paul Duffin2fc82ad2021-04-29 23:36:12 +0100547
548 // Build a profile for the image config and then use that to build the boot image.
549 profile := bootImageProfileRule(ctx, imageConfig)
550 buildBootImage(ctx, imageConfig, profile)
Paul Duffin7ebebfd2021-04-27 19:36:57 +0100551}
552
Paul Duffin7771eba2021-04-23 14:25:28 +0100553type bootclasspathFragmentMemberType struct {
Paul Duffinf7f65da2021-03-10 15:00:46 +0000554 android.SdkMemberTypeBase
555}
556
Paul Duffin7771eba2021-04-23 14:25:28 +0100557func (b *bootclasspathFragmentMemberType) AddDependencies(mctx android.BottomUpMutatorContext, dependencyTag blueprint.DependencyTag, names []string) {
Paul Duffinf7f65da2021-03-10 15:00:46 +0000558 mctx.AddVariationDependencies(nil, dependencyTag, names...)
559}
560
Paul Duffin7771eba2021-04-23 14:25:28 +0100561func (b *bootclasspathFragmentMemberType) IsInstance(module android.Module) bool {
562 _, ok := module.(*BootclasspathFragmentModule)
Paul Duffinf7f65da2021-03-10 15:00:46 +0000563 return ok
564}
565
Paul Duffin7771eba2021-04-23 14:25:28 +0100566func (b *bootclasspathFragmentMemberType) AddPrebuiltModule(ctx android.SdkMemberContext, member android.SdkMember) android.BpModule {
Paul Duffin4b64ba02021-03-29 11:02:53 +0100567 if b.PropertyName == "boot_images" {
568 return ctx.SnapshotBuilder().AddPrebuiltModule(member, "prebuilt_boot_image")
569 } else {
570 return ctx.SnapshotBuilder().AddPrebuiltModule(member, "prebuilt_bootclasspath_fragment")
571 }
Paul Duffinf7f65da2021-03-10 15:00:46 +0000572}
573
Paul Duffin7771eba2021-04-23 14:25:28 +0100574func (b *bootclasspathFragmentMemberType) CreateVariantPropertiesStruct() android.SdkMemberProperties {
575 return &bootclasspathFragmentSdkMemberProperties{}
Paul Duffinf7f65da2021-03-10 15:00:46 +0000576}
577
Paul Duffin7771eba2021-04-23 14:25:28 +0100578type bootclasspathFragmentSdkMemberProperties struct {
Paul Duffinf7f65da2021-03-10 15:00:46 +0000579 android.SdkMemberPropertiesBase
580
Paul Duffina57835e2021-04-19 13:23:06 +0100581 // The image name
Paul Duffin64be7bb2021-03-23 23:06:38 +0000582 Image_name *string
Paul Duffina57835e2021-04-19 13:23:06 +0100583
584 // Contents of the bootclasspath fragment
585 Contents []string
Paul Duffin7c955552021-04-19 13:23:53 +0100586
Paul Duffin895c7142021-04-25 13:40:15 +0100587 // Stub_libs properties.
588 Stub_libs []string
589 Core_platform_stub_libs []string
590
Paul Duffin7c955552021-04-19 13:23:53 +0100591 // Flag files by *hiddenAPIFlagFileCategory
592 Flag_files_by_category map[*hiddenAPIFlagFileCategory]android.Paths
Paul Duffin2fef1362021-04-15 13:32:00 +0100593
594 // The path to the generated stub-flags.csv file.
595 Stub_flags_path android.OptionalPath
596
597 // The path to the generated annotation-flags.csv file.
598 Annotation_flags_path android.OptionalPath
599
600 // The path to the generated metadata.csv file.
601 Metadata_path android.OptionalPath
602
603 // The path to the generated index.csv file.
604 Index_path android.OptionalPath
605
606 // The path to the generated all-flags.csv file.
607 All_flags_path android.OptionalPath
608}
609
610func pathsToOptionalPath(paths android.Paths) android.OptionalPath {
611 switch len(paths) {
612 case 0:
613 return android.OptionalPath{}
614 case 1:
615 return android.OptionalPathForPath(paths[0])
616 default:
617 panic(fmt.Errorf("expected 0 or 1 paths, found %q", paths))
618 }
Paul Duffinf7f65da2021-03-10 15:00:46 +0000619}
620
Paul Duffin7771eba2021-04-23 14:25:28 +0100621func (b *bootclasspathFragmentSdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) {
622 module := variant.(*BootclasspathFragmentModule)
Paul Duffinf7f65da2021-03-10 15:00:46 +0000623
624 b.Image_name = module.properties.Image_name
Paul Duffin2dc665b2021-04-23 16:58:51 +0100625 b.Contents = module.properties.Contents
Paul Duffin7c955552021-04-19 13:23:53 +0100626
627 // Get the flag file information from the module.
628 mctx := ctx.SdkModuleContext()
629 flagFileInfo := mctx.OtherModuleProvider(module, hiddenAPIFlagFileInfoProvider).(hiddenAPIFlagFileInfo)
630 b.Flag_files_by_category = flagFileInfo.categoryToPaths
Paul Duffin895c7142021-04-25 13:40:15 +0100631
Paul Duffin2fef1362021-04-15 13:32:00 +0100632 // Copy all the generated file paths.
633 b.Stub_flags_path = pathsToOptionalPath(flagFileInfo.StubFlagsPaths)
634 b.Annotation_flags_path = pathsToOptionalPath(flagFileInfo.AnnotationFlagsPaths)
635 b.Metadata_path = pathsToOptionalPath(flagFileInfo.MetadataPaths)
636 b.Index_path = pathsToOptionalPath(flagFileInfo.IndexPaths)
637 b.All_flags_path = pathsToOptionalPath(flagFileInfo.AllFlagsPaths)
638
Paul Duffin895c7142021-04-25 13:40:15 +0100639 // Copy stub_libs properties.
640 b.Stub_libs = module.properties.Api.Stub_libs
641 b.Core_platform_stub_libs = module.properties.Core_platform_api.Stub_libs
Paul Duffinf7f65da2021-03-10 15:00:46 +0000642}
643
Paul Duffin7771eba2021-04-23 14:25:28 +0100644func (b *bootclasspathFragmentSdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) {
Paul Duffin64be7bb2021-03-23 23:06:38 +0000645 if b.Image_name != nil {
646 propertySet.AddProperty("image_name", *b.Image_name)
Paul Duffinf7f65da2021-03-10 15:00:46 +0000647 }
Paul Duffina57835e2021-04-19 13:23:06 +0100648
Paul Duffin895c7142021-04-25 13:40:15 +0100649 builder := ctx.SnapshotBuilder()
650 requiredMemberDependency := builder.SdkMemberReferencePropertyTag(true)
651
Paul Duffina57835e2021-04-19 13:23:06 +0100652 if len(b.Contents) > 0 {
Paul Duffin895c7142021-04-25 13:40:15 +0100653 propertySet.AddPropertyWithTag("contents", b.Contents, requiredMemberDependency)
Paul Duffina57835e2021-04-19 13:23:06 +0100654 }
Paul Duffin7c955552021-04-19 13:23:53 +0100655
Paul Duffin895c7142021-04-25 13:40:15 +0100656 if len(b.Stub_libs) > 0 {
657 apiPropertySet := propertySet.AddPropertySet("api")
658 apiPropertySet.AddPropertyWithTag("stub_libs", b.Stub_libs, requiredMemberDependency)
659 }
660 if len(b.Core_platform_stub_libs) > 0 {
661 corePlatformApiPropertySet := propertySet.AddPropertySet("core_platform_api")
662 corePlatformApiPropertySet.AddPropertyWithTag("stub_libs", b.Core_platform_stub_libs, requiredMemberDependency)
663 }
664
Paul Duffin2fef1362021-04-15 13:32:00 +0100665 hiddenAPISet := propertySet.AddPropertySet("hidden_api")
666 hiddenAPIDir := "hiddenapi"
667
668 // Copy manually curated flag files specified on the bootclasspath_fragment.
Paul Duffin7c955552021-04-19 13:23:53 +0100669 if b.Flag_files_by_category != nil {
Paul Duffin7c955552021-04-19 13:23:53 +0100670 for _, category := range hiddenAPIFlagFileCategories {
671 paths := b.Flag_files_by_category[category]
672 if len(paths) > 0 {
673 dests := []string{}
674 for _, p := range paths {
Paul Duffin2fef1362021-04-15 13:32:00 +0100675 dest := filepath.Join(hiddenAPIDir, p.Base())
Paul Duffin7c955552021-04-19 13:23:53 +0100676 builder.CopyToSnapshot(p, dest)
677 dests = append(dests, dest)
678 }
679 hiddenAPISet.AddProperty(category.propertyName, dests)
680 }
681 }
682 }
Paul Duffin2fef1362021-04-15 13:32:00 +0100683
684 copyOptionalPath := func(path android.OptionalPath, property string) {
685 if path.Valid() {
686 p := path.Path()
687 dest := filepath.Join(hiddenAPIDir, p.Base())
688 builder.CopyToSnapshot(p, dest)
689 hiddenAPISet.AddProperty(property, dest)
690 }
691 }
692
693 // Copy all the generated files, if available.
694 copyOptionalPath(b.Stub_flags_path, "stub_flags")
695 copyOptionalPath(b.Annotation_flags_path, "annotation_flags")
696 copyOptionalPath(b.Metadata_path, "metadata")
697 copyOptionalPath(b.Index_path, "index")
698 copyOptionalPath(b.All_flags_path, "all_flags")
Paul Duffinf7f65da2021-03-10 15:00:46 +0000699}
700
Paul Duffin7771eba2021-04-23 14:25:28 +0100701var _ android.SdkMemberType = (*bootclasspathFragmentMemberType)(nil)
Paul Duffinf7f65da2021-03-10 15:00:46 +0000702
Paul Duffin2fef1362021-04-15 13:32:00 +0100703// prebuiltBootclasspathFragmentProperties contains additional prebuilt_bootclasspath_fragment
704// specific properties.
705type prebuiltBootclasspathFragmentProperties struct {
706 Hidden_api struct {
707 // The path to the stub-flags.csv file created by the bootclasspath_fragment.
708 Stub_flags *string `android:"path"`
709
710 // The path to the annotation-flags.csv file created by the bootclasspath_fragment.
711 Annotation_flags *string `android:"path"`
712
713 // The path to the metadata.csv file created by the bootclasspath_fragment.
714 Metadata *string `android:"path"`
715
716 // The path to the index.csv file created by the bootclasspath_fragment.
717 Index *string `android:"path"`
718
719 // The path to the all-flags.csv file created by the bootclasspath_fragment.
720 All_flags *string `android:"path"`
721 }
722}
723
Paul Duffin7771eba2021-04-23 14:25:28 +0100724// A prebuilt version of the bootclasspath_fragment module.
Paul Duffinf7f65da2021-03-10 15:00:46 +0000725//
Paul Duffin7771eba2021-04-23 14:25:28 +0100726// At the moment this is basically just a bootclasspath_fragment module that can be used as a
727// prebuilt. Eventually as more functionality is migrated into the bootclasspath_fragment module
728// type from the various singletons then this will diverge.
729type prebuiltBootclasspathFragmentModule struct {
730 BootclasspathFragmentModule
Paul Duffinf7f65da2021-03-10 15:00:46 +0000731 prebuilt android.Prebuilt
Paul Duffin2fef1362021-04-15 13:32:00 +0100732
733 // Additional prebuilt specific properties.
734 prebuiltProperties prebuiltBootclasspathFragmentProperties
Paul Duffinf7f65da2021-03-10 15:00:46 +0000735}
736
Paul Duffin7771eba2021-04-23 14:25:28 +0100737func (module *prebuiltBootclasspathFragmentModule) Prebuilt() *android.Prebuilt {
Paul Duffinf7f65da2021-03-10 15:00:46 +0000738 return &module.prebuilt
739}
740
Paul Duffin7771eba2021-04-23 14:25:28 +0100741func (module *prebuiltBootclasspathFragmentModule) Name() string {
Paul Duffinf7f65da2021-03-10 15:00:46 +0000742 return module.prebuilt.Name(module.ModuleBase.Name())
743}
744
Paul Duffin2fef1362021-04-15 13:32:00 +0100745// produceHiddenAPIAllFlagsFile returns a path to the prebuilt all-flags.csv or nil if none is
746// specified.
Paul Duffin537ea3d2021-05-14 10:38:00 +0100747func (module *prebuiltBootclasspathFragmentModule) produceHiddenAPIAllFlagsFile(ctx android.ModuleContext, contents []hiddenAPIModule, stubJarsByKind map[android.SdkKind]android.Paths, flagFileInfo *hiddenAPIFlagFileInfo) {
Paul Duffin2fef1362021-04-15 13:32:00 +0100748 pathsForOptionalSrc := func(src *string) android.Paths {
749 if src == nil {
750 // TODO(b/179354495): Fail if this is not provided once prebuilts have been updated.
751 return nil
752 }
753 return android.Paths{android.PathForModuleSrc(ctx, *src)}
754 }
755
756 flagFileInfo.StubFlagsPaths = pathsForOptionalSrc(module.prebuiltProperties.Hidden_api.Stub_flags)
757 flagFileInfo.AnnotationFlagsPaths = pathsForOptionalSrc(module.prebuiltProperties.Hidden_api.Annotation_flags)
758 flagFileInfo.MetadataPaths = pathsForOptionalSrc(module.prebuiltProperties.Hidden_api.Metadata)
759 flagFileInfo.IndexPaths = pathsForOptionalSrc(module.prebuiltProperties.Hidden_api.Index)
760 flagFileInfo.AllFlagsPaths = pathsForOptionalSrc(module.prebuiltProperties.Hidden_api.All_flags)
761}
762
763var _ commonBootclasspathFragment = (*prebuiltBootclasspathFragmentModule)(nil)
764
Paul Duffin7771eba2021-04-23 14:25:28 +0100765func prebuiltBootclasspathFragmentFactory() android.Module {
766 m := &prebuiltBootclasspathFragmentModule{}
Paul Duffin2fef1362021-04-15 13:32:00 +0100767 m.AddProperties(&m.properties, &m.prebuiltProperties)
Paul Duffinf7f65da2021-03-10 15:00:46 +0000768 // This doesn't actually have any prebuilt files of its own so pass a placeholder for the srcs
769 // array.
770 android.InitPrebuiltModule(m, &[]string{"placeholder"})
771 android.InitApexModule(m)
772 android.InitSdkAwareModule(m)
Martin Stjernholmb79c7f12021-03-17 00:26:25 +0000773 android.InitAndroidArchModule(m, android.HostAndDeviceSupported, android.MultilibCommon)
Paul Duffinc7ef9892021-03-23 23:21:59 +0000774
Paul Duffin7771eba2021-04-23 14:25:28 +0100775 // Initialize the contents property from the image_name.
Paul Duffinc7ef9892021-03-23 23:21:59 +0000776 android.AddLoadHook(m, func(ctx android.LoadHookContext) {
Paul Duffin7771eba2021-04-23 14:25:28 +0100777 bootclasspathFragmentInitContentsFromImage(ctx, &m.BootclasspathFragmentModule)
Paul Duffinc7ef9892021-03-23 23:21:59 +0000778 })
Paul Duffinf7f65da2021-03-10 15:00:46 +0000779 return m
780}