Merge "Rename fields in dexpreopt config" am: 564fce4578
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699427 Change-Id: I4b7b7660109810ffccca2711cfe492a5787194c3
This commit is contained in:
commit
f8f3b93130
|
@ -130,9 +130,9 @@ type ModuleConfig struct {
|
|||
ProvidesUsesLibrary string // library name (usually the same as module name)
|
||||
ClassLoaderContexts ClassLoaderContextMap
|
||||
|
||||
Archs []android.ArchType
|
||||
DexPreoptImagesDeps []android.OutputPaths
|
||||
DexPreoptImageLocations []string
|
||||
Archs []android.ArchType
|
||||
DexPreoptImagesDeps []android.OutputPaths
|
||||
DexPreoptImageLocationsOnHost []string // boot image location on host (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
|
||||
|
|
|
@ -330,7 +330,7 @@ func dexpreoptCommand(ctx android.PathContext, globalSoong *GlobalSoongConfig, g
|
|||
Flag("--runtime-arg").FlagWithList("-Xbootclasspath-locations:", module.PreoptBootClassPathDexLocations, ":").
|
||||
Flag("${class_loader_context_arg}").
|
||||
Flag("${stored_class_loader_context_arg}").
|
||||
FlagWithArg("--boot-image=", strings.Join(module.DexPreoptImageLocations, ":")).Implicits(module.DexPreoptImagesDeps[archIdx].Paths()).
|
||||
FlagWithArg("--boot-image=", strings.Join(module.DexPreoptImageLocationsOnHost, ":")).Implicits(module.DexPreoptImagesDeps[archIdx].Paths()).
|
||||
FlagWithInput("--dex-file=", module.DexPath).
|
||||
FlagWithArg("--dex-location=", dexLocationArg).
|
||||
FlagWithOutput("--oat-file=", odexPath).ImplicitOutput(vdexPath).
|
||||
|
|
|
@ -48,7 +48,7 @@ func testModuleConfig(ctx android.PathContext, name, partition string) *ModuleCo
|
|||
ClassLoaderContexts: nil,
|
||||
Archs: []android.ArchType{android.Arm},
|
||||
DexPreoptImagesDeps: []android.OutputPaths{android.OutputPaths{}},
|
||||
DexPreoptImageLocations: []string{},
|
||||
DexPreoptImageLocationsOnHost: []string{},
|
||||
PreoptBootClassPathDexFiles: nil,
|
||||
PreoptBootClassPathDexLocations: nil,
|
||||
PreoptExtractedApk: false,
|
||||
|
|
|
@ -180,11 +180,11 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Wr
|
|||
for _, target := range targets {
|
||||
archs = append(archs, target.Arch.ArchType)
|
||||
variant := bootImage.getVariant(target)
|
||||
images = append(images, variant.images)
|
||||
images = append(images, variant.imagePathOnHost)
|
||||
imagesDeps = append(imagesDeps, variant.imagesDeps)
|
||||
}
|
||||
// The image locations for all Android variants are identical.
|
||||
imageLocations := bootImage.getAnyAndroidVariant().imageLocations()
|
||||
hostImageLocations := bootImage.getAnyAndroidVariant().imageLocations()
|
||||
|
||||
var profileClassListing android.OptionalPath
|
||||
var profileBootListing android.OptionalPath
|
||||
|
@ -224,9 +224,9 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Wr
|
|||
ProvidesUsesLibrary: providesUsesLib,
|
||||
ClassLoaderContexts: d.classLoaderContexts,
|
||||
|
||||
Archs: archs,
|
||||
DexPreoptImagesDeps: imagesDeps,
|
||||
DexPreoptImageLocations: imageLocations,
|
||||
Archs: archs,
|
||||
DexPreoptImagesDeps: imagesDeps,
|
||||
DexPreoptImageLocationsOnHost: hostImageLocations,
|
||||
|
||||
PreoptBootClassPathDexFiles: dexFiles.Paths(),
|
||||
PreoptBootClassPathDexLocations: dexLocations,
|
||||
|
|
|
@ -242,7 +242,7 @@ type bootImageConfig struct {
|
|||
symbolsDir android.OutputPath
|
||||
|
||||
// Subdirectory where the image files are installed.
|
||||
installSubdir string
|
||||
installDirOnHost string
|
||||
|
||||
// A list of (location, jar) pairs for the Java modules in this image.
|
||||
modules android.ConfiguredJarList
|
||||
|
@ -273,8 +273,8 @@ type bootImageVariant struct {
|
|||
dexLocationsDeps []string // for the dependency images and in this image
|
||||
|
||||
// Paths to image files.
|
||||
images android.OutputPath // first image file
|
||||
imagesDeps android.OutputPaths // all files
|
||||
imagePathOnHost android.OutputPath // first image file
|
||||
imagesDeps android.OutputPaths // all files
|
||||
|
||||
// Only for extensions, paths to the primary boot images.
|
||||
primaryImages android.OutputPath
|
||||
|
@ -365,7 +365,7 @@ func (image *bootImageVariant) imageLocations() (imageLocations []string) {
|
|||
if image.extends != nil {
|
||||
imageLocations = image.extends.getVariant(image.target).imageLocations()
|
||||
}
|
||||
return append(imageLocations, dexpreopt.PathToLocation(image.images, image.target.Arch.ArchType))
|
||||
return append(imageLocations, dexpreopt.PathToLocation(image.imagePathOnHost, image.target.Arch.ArchType))
|
||||
}
|
||||
|
||||
func dexpreoptBootJarsFactory() android.SingletonModule {
|
||||
|
@ -604,9 +604,9 @@ func buildBootImageVariant(ctx android.SingletonContext, image *bootImageVariant
|
|||
|
||||
arch := image.target.Arch.ArchType
|
||||
os := image.target.Os.String() // We need to distinguish host-x86 and device-x86.
|
||||
symbolsDir := image.symbolsDir.Join(ctx, os, image.installSubdir, arch.String())
|
||||
symbolsDir := image.symbolsDir.Join(ctx, os, image.installDirOnHost, arch.String())
|
||||
symbolsFile := symbolsDir.Join(ctx, image.stem+".oat")
|
||||
outputDir := image.dir.Join(ctx, os, image.installSubdir, arch.String())
|
||||
outputDir := image.dir.Join(ctx, os, image.installDirOnHost, arch.String())
|
||||
outputPath := outputDir.Join(ctx, image.stem+".oat")
|
||||
oatLocation := dexpreopt.PathToLocation(outputPath, arch)
|
||||
imagePath := outputPath.ReplaceExtension(ctx, "art")
|
||||
|
@ -700,7 +700,7 @@ func buildBootImageVariant(ctx android.SingletonContext, image *bootImageVariant
|
|||
|
||||
cmd.Textf(`|| ( echo %s ; false )`, proptools.ShellEscape(failureMessage))
|
||||
|
||||
installDir := filepath.Join("/", image.installSubdir, arch.String())
|
||||
installDir := filepath.Join("/", image.installDirOnHost, arch.String())
|
||||
|
||||
var vdexInstalls android.RuleBuilderInstalls
|
||||
var unstrippedInstalls android.RuleBuilderInstalls
|
||||
|
@ -943,7 +943,7 @@ func (d *dexpreoptBootJars) MakeVars(ctx android.MakeVarsContext) {
|
|||
}
|
||||
sfx := variant.name + suffix + "_" + variant.target.Arch.ArchType.String()
|
||||
ctx.Strict("DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_"+sfx, variant.vdexInstalls.String())
|
||||
ctx.Strict("DEXPREOPT_IMAGE_"+sfx, variant.images.String())
|
||||
ctx.Strict("DEXPREOPT_IMAGE_"+sfx, variant.imagePathOnHost.String())
|
||||
ctx.Strict("DEXPREOPT_IMAGE_DEPS_"+sfx, strings.Join(variant.imagesDeps.Strings(), " "))
|
||||
ctx.Strict("DEXPREOPT_IMAGE_BUILT_INSTALLED_"+sfx, variant.installs.String())
|
||||
ctx.Strict("DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_"+sfx, variant.unstrippedInstalls.String())
|
||||
|
|
|
@ -83,26 +83,26 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
|
|||
artModules := global.ArtApexJars
|
||||
frameworkModules := global.BootJars.RemoveList(artModules)
|
||||
|
||||
artSubdir := "apex/art_boot_images/javalib"
|
||||
artDirOnHost := "apex/art_boot_images/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",
|
||||
installSubdir: artSubdir,
|
||||
modules: artModules,
|
||||
name: artBootImageName,
|
||||
stem: "boot",
|
||||
installDirOnHost: artDirOnHost,
|
||||
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",
|
||||
installSubdir: frameworkSubdir,
|
||||
modules: frameworkModules,
|
||||
extends: &artCfg,
|
||||
name: frameworkBootImageName,
|
||||
stem: "boot",
|
||||
installDirOnHost: frameworkSubdir,
|
||||
modules: frameworkModules,
|
||||
}
|
||||
|
||||
configs := map[string]*bootImageConfig{
|
||||
|
@ -129,11 +129,11 @@ 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, target.Os.String(), c.installSubdir, arch.String())
|
||||
imageDir := c.dir.Join(ctx, target.Os.String(), c.installDirOnHost, arch.String())
|
||||
variant := &bootImageVariant{
|
||||
bootImageConfig: c,
|
||||
target: target,
|
||||
images: imageDir.Join(ctx, imageName),
|
||||
imagePathOnHost: imageDir.Join(ctx, imageName),
|
||||
imagesDeps: c.moduleFiles(ctx, imageDir, ".art", ".oat", ".vdex"),
|
||||
dexLocations: c.modules.DevicePaths(ctx.Config(), target.Os),
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
|
|||
// specific to the framework config
|
||||
frameworkCfg.dexPathsDeps = append(artCfg.dexPathsDeps, frameworkCfg.dexPathsDeps...)
|
||||
for i := range targets {
|
||||
frameworkCfg.variants[i].primaryImages = artCfg.variants[i].images
|
||||
frameworkCfg.variants[i].primaryImages = artCfg.variants[i].imagePathOnHost
|
||||
frameworkCfg.variants[i].dexLocationsDeps = append(artCfg.variants[i].dexLocations, frameworkCfg.variants[i].dexLocationsDeps...)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue