Merge "bootclasspath_fragment: Add contents to snapshot"
This commit is contained in:
@@ -321,19 +321,33 @@ func (b *bootImageMemberType) CreateVariantPropertiesStruct() android.SdkMemberP
|
||||
type bootImageSdkMemberProperties struct {
|
||||
android.SdkMemberPropertiesBase
|
||||
|
||||
// The image name
|
||||
Image_name *string
|
||||
|
||||
// Contents of the bootclasspath fragment
|
||||
Contents []string
|
||||
}
|
||||
|
||||
func (b *bootImageSdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) {
|
||||
module := variant.(*BootImageModule)
|
||||
|
||||
b.Image_name = module.properties.Image_name
|
||||
if b.Image_name == nil {
|
||||
// Only one of image_name or contents can be specified. However, if image_name is set then the
|
||||
// contents property is updated to match the configuration used to create the corresponding
|
||||
// boot image. Therefore, contents property is only copied if the image name is not specified.
|
||||
b.Contents = module.properties.Contents
|
||||
}
|
||||
}
|
||||
|
||||
func (b *bootImageSdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) {
|
||||
if b.Image_name != nil {
|
||||
propertySet.AddProperty("image_name", *b.Image_name)
|
||||
}
|
||||
|
||||
if len(b.Contents) > 0 {
|
||||
propertySet.AddPropertyWithTag("contents", b.Contents, ctx.SnapshotBuilder().SdkMemberReferencePropertyTag(true))
|
||||
}
|
||||
}
|
||||
|
||||
var _ android.SdkMemberType = (*bootImageMemberType)(nil)
|
||||
|
@@ -200,6 +200,9 @@ func FixtureConfigureBootJars(bootJars ...string) android.FixturePreparer {
|
||||
}),
|
||||
dexpreopt.FixtureSetBootJars(bootJars...),
|
||||
dexpreopt.FixtureSetArtBootJars(artBootJars...),
|
||||
|
||||
// Add a fake dex2oatd module.
|
||||
dexpreopt.PrepareForTestWithFakeDex2oatd,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -212,6 +215,9 @@ func FixtureConfigureUpdatableBootJars(bootJars ...string) android.FixturePrepar
|
||||
variables.UpdatableBootJars = android.CreateTestConfiguredJarList(bootJars)
|
||||
}),
|
||||
dexpreopt.FixtureSetUpdatableBootJars(bootJars...),
|
||||
|
||||
// Add a fake dex2oatd module.
|
||||
dexpreopt.PrepareForTestWithFakeDex2oatd,
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user