summaryrefslogtreecommitdiffstats
path: root/core/static_java_library.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2015-01-14 14:23:56 -0800
committerYing Wang <wangying@google.com>2015-01-20 11:46:59 -0800
commit140274707e31c9585aa28b0de2f1418c64ecd272 (patch)
tree812eda8da0605fe8a018261d052d157aaac5027a /core/static_java_library.mk
parent5ef304001ecb276c83a3fb4e01bae889b90ef7ff (diff)
downloadbuild-140274707e31c9585aa28b0de2f1418c64ecd272.zip
build-140274707e31c9585aa28b0de2f1418c64ecd272.tar.gz
build-140274707e31c9585aa28b0de2f1418c64ecd272.tar.bz2
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
Diffstat (limited to 'core/static_java_library.mk')
-rw-r--r--core/static_java_library.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/static_java_library.mk b/core/static_java_library.mk
index e1b9dd0..c692f9f 100644
--- a/core/static_java_library.mk
+++ b/core/static_java_library.mk
@@ -59,7 +59,7 @@ endif
LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS)
-ifeq ($(strip $(LOCAL_USE_JACK)),true)
+ifeq ($(LOCAL_USE_JACK),true)
ifndef LOCAL_JACK_PROGUARD_FLAGS
LOCAL_JACK_PROGUARD_FLAGS := $(LOCAL_PROGUARD_FLAGS)
endif
@@ -123,7 +123,7 @@ $(R_file_stamp) : $(all_resources) $(full_android_manifest) $(AAPT) $(framework_
$(hide) find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name R.java | xargs cat > $@
$(LOCAL_BUILT_MODULE): $(R_file_stamp)
-ifeq ($(strip $(LOCAL_USE_JACK)),true)
+ifeq ($(LOCAL_USE_JACK),true)
$(noshrob_classes_jack): $(R_file_stamp)
$(full_classes_jack): $(R_file_stamp)
endif # LOCAL_USE_JACK