From bd30285e436f33b65f92b167cd48ecc1d36c7b54 Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Thu, 24 Oct 2019 17:26:18 +0100 Subject: Package dexpreopt artifacts for libcore jars in the ART apex. This patchset removes the obsolete preinstall hook that was used to run dex2oat to dexpreopt bootclasspath jars when installing the apex on device. Instead, this patchset adds precompiled dexpreopt files for the libcore part of bootclasspath in the apex. See the related patch in build/soong. The dexpreopt files are packaged in dexpreopt/$ARCH/ subdirectory and have names prefixed with 'boot-art'. Test: m Test: m com.android.art deapexer \ && find $ANDROID_BUILD_TOP -type f -name 'com.android.art.*.apex \ | xargs deapexer | grep boot \ Expect to find dexpreopt/$ARCH/boot-art*.{art,oat,vdex} files. Test: art/build/apex/runtests.sh Change-Id: I52a9a4d726d0da5a1cc52644351275cd3bb0f0d3 --- build/art.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'build/art.go') diff --git a/build/art.go b/build/art.go index 56eec54138..4c1099bc98 100644 --- a/build/art.go +++ b/build/art.go @@ -312,6 +312,10 @@ func init() { android.RegisterModuleType("art_global_defaults", artGlobalDefaultsFactory) android.RegisterModuleType("art_debug_defaults", artDebugDefaultsFactory) + // ART apex is special because it must include dexpreopt files for bootclasspath jars. + android.RegisterModuleType("art_apex", artApexBundleFactory) + android.RegisterModuleType("art_apex_test", artTestApexBundleFactory) + // TODO: This makes the module disable itself for host if HOST_PREFER_32_BIT is // set. We need this because the multilib types of binaries listed in the apex // rule must match the declared type. This is normally not difficult but HOST_PREFER_32_BIT @@ -321,8 +325,16 @@ func init() { android.RegisterModuleType("art_apex_test_host", artHostTestApexBundleFactory) } +func artApexBundleFactory() android.Module { + return apex.ApexBundleFactory(false /*testApex*/, true /*artApex*/) +} + +func artTestApexBundleFactory() android.Module { + return apex.ApexBundleFactory(true /*testApex*/, true /*artApex*/) +} + func artHostTestApexBundleFactory() android.Module { - module := apex.ApexBundleFactory( /*testApex*/ true) + module := apex.ApexBundleFactory(true /*testApex*/, true /*artApex*/) android.AddLoadHook(module, func(ctx android.LoadHookContext) { if envTrue(ctx, "HOST_PREFER_32_BIT") { type props struct { -- cgit v1.2.3-59-g8ed1b