OSDN Git Service

Rebuild odex files in PDK fusion build.
authorYing Wang <wangying@google.com>
Fri, 11 Mar 2016 18:32:01 +0000 (10:32 -0800)
committerYing Wang <wangying@google.com>
Fri, 25 Mar 2016 18:06:04 +0000 (11:06 -0700)
commitfbc5b9f56b89dfeacbb05f9e780e5c0a34feabdb
tree2a7e6b18325267f3cff5de98072df34e3f9a39c7
parent6557ba5335798627572669512489fdc8c59915a6
Rebuild odex files in PDK fusion build.

To rebuild odex files of Java libraries and apps,
we store the jars/apks without stripping the classes.dex inside the
platform.zip. We also save the build variables that may affect how we
rebuild an odex in pdk_dexpreopt_config.mk in the platform.zip.
We store the files and configuration only for libraries/apps that get
installed to the system.img (or vendor.img).

In PDK fusion build, we auto-generate prebuilt module definitions for
the javalib.jar and package.dex.apk carried in the platform.zip, using
configuration stored in pdk_dexpreopt_config.mk.
With the prebult modules, we override the implicit rule that directly
copies the odex from the platform.zip.
To rebuild odex of javalib.jar, we added support for prebuilt shared Java
library to prebiult_internal.mk. An installable prebuilt Java library is
treated as shared Java library, i.e. with classes.dex in the jar instead
of a set of .class files.
For apks in the platform.zip, we install the stripped version from
platform files inside platform.zip, instead of the package.dex.apk,
using a new variable LOCAL_REPLACE_PREBUILT_APK_INSTALLED. We can't
strip package.dex.apk because we can't re-sign the stripped apk at this
point.

We generate prebuilt module only if it's not already defined in the
source tree.

Bug: 27543283
Change-Id: I9e146f8b713d6f57c397fd28d88c9ab700757ca1
(cherry-pick from commit 3a61eeb6cb588b9a206bd80814183bcc0263cd13)
12 files changed:
core/Makefile
core/clear_vars.mk
core/config.mk
core/definitions.mk
core/dex_preopt.mk
core/dex_preopt_libart.mk
core/dex_preopt_libart_boot.mk
core/dex_preopt_odex_install.mk
core/main.mk
core/package_internal.mk
core/pdk_fusion_modules.mk [new file with mode: 0644]
core/prebuilt_internal.mk