Generate the ART boot image for host as well (used by ART tests).

This will allow us to remove the core.art image compiled in make.

Test: lunch aosp_x86_64 && m test-art-host-gtest
Bug: 147817558
Bug: 147819342
Change-Id: I864f72198d875dc1421c9c029a683bafbe7b71ac
This commit is contained in:
David Srbecky
2020-02-13 16:00:45 +00:00
parent 8f20563514
commit 7f8dac1254
3 changed files with 48 additions and 37 deletions

View File

@@ -68,6 +68,10 @@ func dexpreoptTargets(ctx android.PathContext) []android.Target {
targets = append(targets, target)
}
}
// We may also need the images on host in order to run host-based tests.
for _, target := range ctx.Config().Targets[android.BuildOs] {
targets = append(targets, target)
}
return targets
}
@@ -152,7 +156,7 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
// expands to <stem>.art for primary image and <stem>-<1st module>.art for extension
imageName := c.firstModuleNameOrStem() + ".art"
c.imageLocations = []string{c.dir.Join(ctx, c.installSubdir, imageName).String()}
c.imageLocations = []string{c.dir.Join(ctx, "android", c.installSubdir, imageName).String()}
// The path to bootclasspath dex files needs to be known at module
// GenerateAndroidBuildAction time, before the bootclasspath modules have been compiled.
@@ -167,7 +171,7 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
// Create target-specific variants.
for _, target := range targets {
arch := target.Arch.ArchType
imageDir := c.dir.Join(ctx, c.installSubdir, arch.String())
imageDir := c.dir.Join(ctx, target.Os.String(), c.installSubdir, arch.String())
variant := &bootImageVariant{
bootImageConfig: c,
target: target,