Commit graph

3 commits

Author SHA1 Message Date
Narayan Kamath
c1ed9796bb Revert "Running jarjar on Java resources."
This reverts commit 140274707e.

Breaks the build on uiautomator_compat.

Change-Id: I6d14f39e3432bf5e691027bbb8e7260e4bec8e8d
2015-01-21 11:04:22 +00:00
Ying Wang
140274707e Running jarjar on Java resources.
Before this change, Java resources are added as a separate step
(add-java-resources-to-package) after dex is run, so jarjar isn't run on
the resource files.
With this change, we add Java resources immediately after we call javac,
so jarjar is run on the resource files (the module's own resource, as
well as resources carried by static Java libraries).
When we generate the final apk/jar, we use the jarjar'ed jar as the
inital pacakge file, with class files and empty folders removed.

When jack is enabled, in jack-java-to-dex we add the Java resources to
a temp jar using the PRIVATE_EXTRA_JAR_ARGS, and extrac the files in a
temp dir. Jack will process the resource files and output the result to
PRIVATE_JACK_INTERMEDIATES_DIR. When we package the final apk/jar, we
need to call add-carried-jack-resources to readd the resources.
(TODO: if jack can output all resources to a jar/zip file, we can use
that file as the initial package file as well.)

Bug: 18837479
Change-Id: I15ecf282bfb65fd53dd03fbd03dd4c71927c186a
2015-01-20 11:46:59 -08:00
Ying Wang
8070b20f9e Support to build dpi-specific apk variants.
In unbundled apps_only build, in addition to the base apk, you can also
build the dpi-specific apk variants, with:
LOCAL_DPI_VARIANTS := <a list of dpi names>

Previously user needs to include $(BUILD_PACKAGE) repeatedly with the
same package definition except dpi flags.
With this change, all the dpi-specific apk variants share the base apk's
compiled Java code and only diverge at the point we add resources/assets
to the apk.
Also we set up variables/targets/rules in a way those dpi-specific apks
appear to be independent apks to the users, for example, you can pass
"AppName_<dpi_name>" to tapas, and AppName_<dpi_name>.apk lives in its
own intermediate directory.

Bug: 18388705
Change-Id: I2ba4972ea7d1f796352fab2407888f996781ae44
2014-12-02 18:17:55 +00:00