OSDN Git Service

Running jarjar on Java resources.
authorYing Wang <wangying@google.com>
Wed, 14 Jan 2015 22:23:56 +0000 (14:23 -0800)
committerYing Wang <wangying@google.com>
Tue, 20 Jan 2015 19:46:59 +0000 (11:46 -0800)
commit140274707e31c9585aa28b0de2f1418c64ecd272
tree812eda8da0605fe8a018261d052d157aaac5027a
parent5ef304001ecb276c83a3fb4e01bae889b90ef7ff
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
core/base_rules.mk
core/definitions.mk
core/dpi_specific_apk.mk
core/host_dalvik_java_library.mk
core/java.mk
core/java_library.mk
core/package_internal.mk
core/static_java_library.mk