Merge "Add bootclasspath_fragment as an alias for boot_image" am: 755b10fe53
am: 0c541b7c1d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655217 Change-Id: Id99ca66bcec57e6fb4937479c789592609e45290
This commit is contained in:
@@ -93,8 +93,14 @@ type apexBundleProperties struct {
|
|||||||
Multilib apexMultilibProperties
|
Multilib apexMultilibProperties
|
||||||
|
|
||||||
// List of boot images that are embedded inside this APEX bundle.
|
// List of boot images that are embedded inside this APEX bundle.
|
||||||
|
//
|
||||||
|
// deprecated: Use Bootclasspath_fragments
|
||||||
|
// TODO(b/177892522): Remove after has been replaced by Bootclasspath_fragments
|
||||||
Boot_images []string
|
Boot_images []string
|
||||||
|
|
||||||
|
// List of bootclasspath fragments that are embedded inside this APEX bundle.
|
||||||
|
Bootclasspath_fragments []string
|
||||||
|
|
||||||
// List of java libraries that are embedded inside this APEX bundle.
|
// List of java libraries that are embedded inside this APEX bundle.
|
||||||
Java_libs []string
|
Java_libs []string
|
||||||
|
|
||||||
@@ -748,6 +754,7 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||||||
// Common-arch dependencies come next
|
// Common-arch dependencies come next
|
||||||
commonVariation := ctx.Config().AndroidCommonTarget.Variations()
|
commonVariation := ctx.Config().AndroidCommonTarget.Variations()
|
||||||
ctx.AddFarVariationDependencies(commonVariation, bootImageTag, a.properties.Boot_images...)
|
ctx.AddFarVariationDependencies(commonVariation, bootImageTag, a.properties.Boot_images...)
|
||||||
|
ctx.AddFarVariationDependencies(commonVariation, bootImageTag, a.properties.Bootclasspath_fragments...)
|
||||||
ctx.AddFarVariationDependencies(commonVariation, javaLibTag, a.properties.Java_libs...)
|
ctx.AddFarVariationDependencies(commonVariation, javaLibTag, a.properties.Java_libs...)
|
||||||
ctx.AddFarVariationDependencies(commonVariation, bpfTag, a.properties.Bpfs...)
|
ctx.AddFarVariationDependencies(commonVariation, bpfTag, a.properties.Bpfs...)
|
||||||
ctx.AddFarVariationDependencies(commonVariation, fsTag, a.properties.Filesystems...)
|
ctx.AddFarVariationDependencies(commonVariation, fsTag, a.properties.Filesystems...)
|
||||||
|
@@ -27,17 +27,29 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
RegisterBootImageBuildComponents(android.InitRegistrationContext)
|
RegisterBootImageBuildComponents(android.InitRegistrationContext)
|
||||||
|
|
||||||
|
// TODO(b/177892522): Remove after has been replaced by bootclasspath_fragments
|
||||||
android.RegisterSdkMemberType(&bootImageMemberType{
|
android.RegisterSdkMemberType(&bootImageMemberType{
|
||||||
SdkMemberTypeBase: android.SdkMemberTypeBase{
|
SdkMemberTypeBase: android.SdkMemberTypeBase{
|
||||||
PropertyName: "boot_images",
|
PropertyName: "boot_images",
|
||||||
SupportsSdk: true,
|
SupportsSdk: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
android.RegisterSdkMemberType(&bootImageMemberType{
|
||||||
|
SdkMemberTypeBase: android.SdkMemberTypeBase{
|
||||||
|
PropertyName: "bootclasspath_fragments",
|
||||||
|
SupportsSdk: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterBootImageBuildComponents(ctx android.RegistrationContext) {
|
func RegisterBootImageBuildComponents(ctx android.RegistrationContext) {
|
||||||
|
// TODO(b/177892522): Remove after has been replaced by bootclasspath_fragment
|
||||||
ctx.RegisterModuleType("boot_image", bootImageFactory)
|
ctx.RegisterModuleType("boot_image", bootImageFactory)
|
||||||
ctx.RegisterModuleType("prebuilt_boot_image", prebuiltBootImageFactory)
|
ctx.RegisterModuleType("prebuilt_boot_image", prebuiltBootImageFactory)
|
||||||
|
|
||||||
|
ctx.RegisterModuleType("bootclasspath_fragment", bootImageFactory)
|
||||||
|
ctx.RegisterModuleType("prebuilt_bootclasspath_fragment", prebuiltBootImageFactory)
|
||||||
}
|
}
|
||||||
|
|
||||||
type bootImageProperties struct {
|
type bootImageProperties struct {
|
||||||
@@ -172,7 +184,11 @@ func (b *bootImageMemberType) IsInstance(module android.Module) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *bootImageMemberType) AddPrebuiltModule(ctx android.SdkMemberContext, member android.SdkMember) android.BpModule {
|
func (b *bootImageMemberType) AddPrebuiltModule(ctx android.SdkMemberContext, member android.SdkMember) android.BpModule {
|
||||||
return ctx.SnapshotBuilder().AddPrebuiltModule(member, "prebuilt_boot_image")
|
if b.PropertyName == "boot_images" {
|
||||||
|
return ctx.SnapshotBuilder().AddPrebuiltModule(member, "prebuilt_boot_image")
|
||||||
|
} else {
|
||||||
|
return ctx.SnapshotBuilder().AddPrebuiltModule(member, "prebuilt_bootclasspath_fragment")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *bootImageMemberType) CreateVariantPropertiesStruct() android.SdkMemberProperties {
|
func (b *bootImageMemberType) CreateVariantPropertiesStruct() android.SdkMemberProperties {
|
||||||
|
@@ -41,6 +41,18 @@ func TestUnknownBootImage(t *testing.T) {
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUnknownBootclasspathFragmentImageName(t *testing.T) {
|
||||||
|
prepareForTestWithBootImage.
|
||||||
|
ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(
|
||||||
|
`\Qimage_name: Unknown image name "unknown", expected one of art, boot\E`)).
|
||||||
|
RunTestWithBp(t, `
|
||||||
|
bootclasspath_fragment {
|
||||||
|
name: "unknown-boot-image",
|
||||||
|
image_name: "unknown",
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
func TestUnknownPrebuiltBootImage(t *testing.T) {
|
func TestUnknownPrebuiltBootImage(t *testing.T) {
|
||||||
prepareForTestWithBootImage.
|
prepareForTestWithBootImage.
|
||||||
ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(
|
ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(
|
||||||
|
Reference in New Issue
Block a user