summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/boot_image.go14
-rw-r--r--java/testing.go6
2 files changed, 20 insertions, 0 deletions
diff --git a/java/boot_image.go b/java/boot_image.go
index a14538b62..3c0181f23 100644
--- a/java/boot_image.go
+++ b/java/boot_image.go
@@ -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)
diff --git a/java/testing.go b/java/testing.go
index aee0710c4..08a71b880 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -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,
)
}