Merge "Rename BootImageInfo to BootclasspathFragmentApexContentInfo" am: 71c84696f9

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686216

Change-Id: I0f529c8a2bf540941833aef162bc68e4b7997f61
This commit is contained in:
Paul Duffin
2021-04-26 16:18:25 +00:00
committed by Automerger Merge Worker
3 changed files with 14 additions and 12 deletions

View File

@@ -1699,8 +1699,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
ctx.PropertyErrorf("bootclasspath_fragments", "%q is not a boot_image module", depName) ctx.PropertyErrorf("bootclasspath_fragments", "%q is not a boot_image module", depName)
return false return false
} }
bootImageInfo := ctx.OtherModuleProvider(child, java.BootImageInfoProvider).(java.BootImageInfo) bootclasspathFragmentInfo := ctx.OtherModuleProvider(child, java.BootclasspathFragmentApexContentInfoProvider).(java.BootclasspathFragmentApexContentInfo)
for arch, files := range bootImageInfo.AndroidBootImageFilesByArchType() { for arch, files := range bootclasspathFragmentInfo.AndroidBootImageFilesByArchType() {
dirInApex := filepath.Join("javalib", arch.String()) dirInApex := filepath.Join("javalib", arch.String())
for _, f := range files { for _, f := range files {
androidMkModuleName := "javalib_" + arch.String() + "_" + filepath.Base(f.String()) androidMkModuleName := "javalib_" + arch.String() + "_" + filepath.Base(f.String())

View File

@@ -143,13 +143,13 @@ func checkBootclasspathFragment(t *testing.T, result *android.TestResult, module
bootclasspathFragment := result.ModuleForTests(moduleName, "android_common").Module().(*java.BootclasspathFragmentModule) bootclasspathFragment := result.ModuleForTests(moduleName, "android_common").Module().(*java.BootclasspathFragmentModule)
bootImageInfo := result.ModuleProvider(bootclasspathFragment, java.BootImageInfoProvider).(java.BootImageInfo) bootclasspathFragmentInfo := result.ModuleProvider(bootclasspathFragment, java.BootclasspathFragmentApexContentInfoProvider).(java.BootclasspathFragmentApexContentInfo)
modules := bootImageInfo.Modules() modules := bootclasspathFragmentInfo.Modules()
android.AssertStringEquals(t, "invalid modules for "+moduleName, expectedConfiguredModules, modules.String()) android.AssertStringEquals(t, "invalid modules for "+moduleName, expectedConfiguredModules, modules.String())
// Get a list of all the paths in the boot image sorted by arch type. // Get a list of all the paths in the boot image sorted by arch type.
allPaths := []string{} allPaths := []string{}
bootImageFilesByArchType := bootImageInfo.AndroidBootImageFilesByArchType() bootImageFilesByArchType := bootclasspathFragmentInfo.AndroidBootImageFilesByArchType()
for _, archType := range android.ArchTypeList() { for _, archType := range android.ArchTypeList() {
if paths, ok := bootImageFilesByArchType[archType]; ok { if paths, ok := bootImageFilesByArchType[archType]; ok {
for _, path := range paths { for _, path := range paths {

View File

@@ -165,24 +165,26 @@ func bootclasspathFragmentInitContentsFromImage(ctx android.EarlyModuleContext,
} }
} }
var BootImageInfoProvider = blueprint.NewProvider(BootImageInfo{}) var BootclasspathFragmentApexContentInfoProvider = blueprint.NewProvider(BootclasspathFragmentApexContentInfo{})
type BootImageInfo struct { // BootclasspathFragmentApexContentInfo contains the bootclasspath_fragments contributions to the
// apex contents.
type BootclasspathFragmentApexContentInfo struct {
// The image config, internal to this module (and the dex_bootjars singleton). // The image config, internal to this module (and the dex_bootjars singleton).
// //
// Will be nil if the BootImageInfo has not been provided for a specific module. That can occur // Will be nil if the BootclasspathFragmentApexContentInfo has not been provided for a specific module. That can occur
// when SkipDexpreoptBootJars(ctx) returns true. // when SkipDexpreoptBootJars(ctx) returns true.
imageConfig *bootImageConfig imageConfig *bootImageConfig
} }
func (i BootImageInfo) Modules() android.ConfiguredJarList { func (i BootclasspathFragmentApexContentInfo) Modules() android.ConfiguredJarList {
return i.imageConfig.modules return i.imageConfig.modules
} }
// Get a map from ArchType to the associated boot image's contents for Android. // Get a map from ArchType to the associated boot image's contents for Android.
// //
// Extension boot images only return their own files, not the files of the boot images they extend. // Extension boot images only return their own files, not the files of the boot images they extend.
func (i BootImageInfo) AndroidBootImageFilesByArchType() map[android.ArchType]android.OutputPaths { func (i BootclasspathFragmentApexContentInfo) AndroidBootImageFilesByArchType() map[android.ArchType]android.OutputPaths {
files := map[android.ArchType]android.OutputPaths{} files := map[android.ArchType]android.OutputPaths{}
if i.imageConfig != nil { if i.imageConfig != nil {
for _, variant := range i.imageConfig.variants { for _, variant := range i.imageConfig.variants {
@@ -264,10 +266,10 @@ func (b *BootclasspathFragmentModule) GenerateAndroidBuildActions(ctx android.Mo
} }
// Construct the boot image info from the config. // Construct the boot image info from the config.
info := BootImageInfo{imageConfig: imageConfig} info := BootclasspathFragmentApexContentInfo{imageConfig: imageConfig}
// Make it available for other modules. // Make it available for other modules.
ctx.SetProvider(BootImageInfoProvider, info) ctx.SetProvider(BootclasspathFragmentApexContentInfoProvider, info)
} }
func (b *BootclasspathFragmentModule) getImageConfig(ctx android.EarlyModuleContext) *bootImageConfig { func (b *BootclasspathFragmentModule) getImageConfig(ctx android.EarlyModuleContext) *bootImageConfig {