Revert^4 "Package dexpreopt artifacts for libcore jars in the ART apex."

This reverts commit bf0e47648a.

Reason for revert: coverage build with EMMA_INSTRUMENT_FRAMEWORK=true
is fixed by inspecting the environment variable and not generating
boot image in case it is set.

Dexpreopt artifacts for the libcore part of the boot class path are
now packaged in the ART apex. The system image still contains
dexpreopt artifacts for the full set of boot class path libraries
(both libcore and framework); the libcore part will be removed and
boot image extension will be used in a follow-up CL.

Since this is specific to the ART apex and makes no sense for other
apexes, the implementation adds a boolean flag "is ART apex" rather
than a new apex module property.

Build rules for the new set of dexpreopt artifacts are created using
a new variant of the global boot image config. Previously we had two
variants: "default" (for the system image) and "apex" (for the
JIT-zygote experiment). This patch adds a third "art" variant.

Test: m
Test: m art/build/apex/runtests.sh

Bug: 144091989
Change-Id: I113c0d39222d6d697cb62cd09d5010607872fc2b
This commit is contained in:
Ulyana Trafimovich
2019-11-08 10:51:01 +00:00
committed by Ulya Trafimovich
parent 1f38237c12
commit de534414b3
4 changed files with 89 additions and 38 deletions

View File

@@ -637,6 +637,7 @@ type apexBundle struct {
testApex bool
vndkApex bool
artApex bool
primaryApexType bool
// intermediate path for apex_manifest.json
@@ -1244,6 +1245,19 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
return false
})
// Specific to the ART apex: dexpreopt artifacts for libcore Java libraries.
// Build rules are generated by the dexpreopt singleton, and here we access build artifacts
// via the global boot image config.
if a.artApex {
for arch, files := range java.DexpreoptedArtApexJars(ctx) {
dirInApex := filepath.Join("javalib", arch.String())
for _, f := range files {
localModule := "javalib_" + arch.String() + "_" + filepath.Base(f.String())
filesInfo = append(filesInfo, apexFile{f, localModule, dirInApex, etc, nil, nil})
}
}
}
if a.private_key_file == nil {
ctx.PropertyErrorf("key", "private_key for %q could not be found", String(a.properties.Key))
return
@@ -1832,9 +1846,10 @@ func newApexBundle() *apexBundle {
return module
}
func ApexBundleFactory(testApex bool) android.Module {
func ApexBundleFactory(testApex bool, artApex bool) android.Module {
bundle := newApexBundle()
bundle.testApex = testApex
bundle.artApex = artApex
return bundle
}