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
diff --git a/dexpreopt/config.go b/dexpreopt/config.go
index 1844bce..7e73bf7 100644
--- a/dexpreopt/config.go
+++ b/dexpreopt/config.go
@@ -130,9 +130,11 @@
ProvidesUsesLibrary string // library name (usually the same as module name)
ClassLoaderContexts ClassLoaderContextMap
- Archs []android.ArchType
- DexPreoptImagesDeps []android.OutputPaths
- DexPreoptImageLocationsOnHost []string // boot image location on host (file path without the arch subdirectory)
+ Archs []android.ArchType
+ DexPreoptImagesDeps []android.OutputPaths
+
+ DexPreoptImageLocationsOnHost []string // boot image location on host (file path without the arch subdirectory)
+ DexPreoptImageLocationsOnDevice []string // boot image location on device (file path without the arch subdirectory)
PreoptBootClassPathDexFiles android.Paths // file paths of boot class path files
PreoptBootClassPathDexLocations []string // virtual locations of boot class path files