Dexpreopt ART jars and framework jars together.

Bug: 280776428
Test: atest art_standalone_dexpreopt_tests
Test: -
  1. m
  2. Check .invocation file (http://gpaste/6498044089466880)
  3. Check files in $ANDROID_PRODUCT_OUT/system/framework/x86_64
Test: -
  1. m dist
  2. Check files in out/dist/boot.zip
Test: -
  1. art/tools/buildbot-build.sh --host
  2. m test-art-host-gtest
  3. art/test/testrunner/testrunner.py --host
Test: m build-art-target-golem
Change-Id: I89490252e56a05edab03fdddc6539fa4d7f79756
This commit is contained in:
Jiakai Zhang
2023-05-10 18:38:34 +01:00
parent 09d88df040
commit c08c162b5a
7 changed files with 520 additions and 170 deletions

View File

@@ -295,6 +295,11 @@ type bootImageConfig struct {
// The "--single-image" argument.
singleImage bool
// Profiles imported from other boot image configs. Each element must represent a
// `bootclasspath_fragment` of an APEX (i.e., the `name` field of each element must refer to the
// `image_name` property of a `bootclasspath_fragment`).
profileImports []*bootImageConfig
}
// Target-dependent description of a boot image.
@@ -711,6 +716,34 @@ func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, p
cmd.FlagWithInput("--profile-file=", profile)
}
fragments := make(map[string]commonBootclasspathFragment)
ctx.VisitDirectDepsWithTag(bootclasspathFragmentDepTag, func(child android.Module) {
fragment := child.(commonBootclasspathFragment)
if fragment.getImageName() != nil && android.IsModulePreferred(child) {
fragments[*fragment.getImageName()] = fragment
}
})
for _, profileImport := range image.profileImports {
fragment := fragments[profileImport.name]
if fragment == nil {
ctx.ModuleErrorf("Boot image config '%[1]s' imports profile from '%[2]s', but a "+
"bootclasspath_fragment with image name '%[2]s' doesn't exist or is not added as a "+
"dependency of '%[1]s'",
image.name,
profileImport.name)
return bootImageVariantOutputs{}
}
if fragment.getProfilePath() == nil {
ctx.ModuleErrorf("Boot image config '%[1]s' imports profile from '%[2]s', but '%[2]s' "+
"doesn't provide a profile",
image.name,
profileImport.name)
return bootImageVariantOutputs{}
}
cmd.FlagWithInput("--profile-file=", fragment.getProfilePath())
}
dirtyImageFile := "frameworks/base/config/dirty-image-objects"
dirtyImagePath := android.ExistentPathForSource(ctx, dirtyImageFile)
if dirtyImagePath.Valid() {