summaryrefslogtreecommitdiff
path: root/java/dexpreopt_config.go
diff options
context:
space:
mode:
author Jeongik Cha <jeongik@google.com> 2021-04-27 23:56:44 +0900
committer Jeongik Cha <jeongik@google.com> 2021-05-15 00:29:49 +0900
commit4dda75e73e3e52e11b1cd37af33645fcfe5ed980 (patch)
tree930a34f728c5073e2bfaaad369d384b2fec466ba /java/dexpreopt_config.go
parent015a0afe07cd5ed38ec72af5ae6059c247e5f841 (diff)
Add usesTargetFiles option in dexpreopt_gen
For running dex2oat on the target_files, the paths should be use the device install path instead of the path starting with $(OUT). So add usesTargetFiles option and basePath option which indicates extracted path. With those options, the path is replaced with $(basePath)/$(device path) And also, add DexPreoptImageDeviceLocations in the config which refers to the boot image path(without arch) on the device. Because DexPreoptImage related device path was missing. Bug: 158843648 Test: dexpreopt_gen -usesTargetFiles -basePath (extract path) and then check if paths in the generated shell script are based on on-device path. Change-Id: I9667fadbf3b7c6f770e0d1bcbee5d67c1ecd8a3d
Diffstat (limited to 'java/dexpreopt_config.go')
-rw-r--r--java/dexpreopt_config.go32
1 files changed, 18 insertions, 14 deletions
diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go
index 7fb0444c2..37248609d 100644
--- a/java/dexpreopt_config.go
+++ b/java/dexpreopt_config.go
@@ -84,25 +84,28 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
frameworkModules := global.BootJars.RemoveList(artModules)
artDirOnHost := "apex/art_boot_images/javalib"
+ artDirOnDevice := "apex/com.android.art/javalib"
frameworkSubdir := "system/framework"
// ART config for the primary boot image in the ART apex.
// It includes the Core Libraries.
artCfg := bootImageConfig{
- name: artBootImageName,
- stem: "boot",
- installDirOnHost: artDirOnHost,
- modules: artModules,
+ name: artBootImageName,
+ stem: "boot",
+ installDirOnHost: artDirOnHost,
+ installDirOnDevice: artDirOnDevice,
+ modules: artModules,
}
// Framework config for the boot image extension.
// It includes framework libraries and depends on the ART config.
frameworkCfg := bootImageConfig{
- extends: &artCfg,
- name: frameworkBootImageName,
- stem: "boot",
- installDirOnHost: frameworkSubdir,
- modules: frameworkModules,
+ extends: &artCfg,
+ name: frameworkBootImageName,
+ stem: "boot",
+ installDirOnHost: frameworkSubdir,
+ installDirOnDevice: frameworkSubdir,
+ modules: frameworkModules,
}
configs := map[string]*bootImageConfig{
@@ -131,11 +134,12 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
arch := target.Arch.ArchType
imageDir := c.dir.Join(ctx, target.Os.String(), c.installDirOnHost, arch.String())
variant := &bootImageVariant{
- bootImageConfig: c,
- target: target,
- imagePathOnHost: imageDir.Join(ctx, imageName),
- imagesDeps: c.moduleFiles(ctx, imageDir, ".art", ".oat", ".vdex"),
- dexLocations: c.modules.DevicePaths(ctx.Config(), target.Os),
+ bootImageConfig: c,
+ target: target,
+ imagePathOnHost: imageDir.Join(ctx, imageName),
+ imagePathOnDevice: filepath.Join("/", c.installDirOnDevice, arch.String(), imageName),
+ imagesDeps: c.moduleFiles(ctx, imageDir, ".art", ".oat", ".vdex"),
+ dexLocations: c.modules.DevicePaths(ctx.Config(), target.Os),
}
variant.dexLocationsDeps = variant.dexLocations
c.variants = append(c.variants, variant)