summaryrefslogtreecommitdiffstats
path: root/core/static_java_library.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-06-25 23:03:02 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-25 23:03:02 +0000
commit01b179bf3b5c4c0307e0efb4004a1c44705fe780 (patch)
tree787d845f77cb401fadd697988a320f5cbf2561fd /core/static_java_library.mk
parent0858c65a4d2e9cda9b9a6017bc1f4bf32125cafc (diff)
parentbb964f00403a23d2f1ec3313f7b579a9e7f0f12a (diff)
downloadbuild-01b179bf3b5c4c0307e0efb4004a1c44705fe780.zip
build-01b179bf3b5c4c0307e0efb4004a1c44705fe780.tar.gz
build-01b179bf3b5c4c0307e0efb4004a1c44705fe780.tar.bz2
am bb964f00: am 432cd6dd: Merge "Allow LOCAL_RESOURCE_DIR pointing to dir generated during the build"
* commit 'bb964f00403a23d2f1ec3313f7b579a9e7f0f12a': Allow LOCAL_RESOURCE_DIR pointing to dir generated during the build
Diffstat (limited to 'core/static_java_library.mk')
-rw-r--r--core/static_java_library.mk9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/static_java_library.mk b/core/static_java_library.mk
index f31ccd8..8e6029d 100644
--- a/core/static_java_library.mk
+++ b/core/static_java_library.mk
@@ -26,7 +26,10 @@ LOCAL_MODULE_CLASS := JAVA_LIBRARIES
# Hack to build static Java library with Android resource
# See bug 5714516
all_resources :=
+need_compile_res :=
+# A static Java library needs to explicily set LOCAL_RESOURCE_DIR.
ifdef LOCAL_RESOURCE_DIR
+need_compile_res := true
all_resources := $(strip \
$(foreach dir, $(LOCAL_RESOURCE_DIR), \
$(addprefix $(dir)/, \
@@ -36,7 +39,6 @@ all_resources := $(strip \
) \
))
-ifneq (,$(all_resources))
# By default we should remove the R/Manifest classes from a static Java library,
# because they will be regenerated in the app that uses it.
# But if the static Java library will be used by a library, then we may need to
@@ -56,14 +58,13 @@ ifneq ($(LOCAL_PROGUARD_ENABLED),custom)
endif
LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS)
-endif # all_resources
endif # LOCAL_RESOURCE_DIR
all_res_assets := $(all_resources)
include $(BUILD_SYSTEM)/java_library.mk
-ifneq (,$(all_resources))
+ifeq (true,$(need_compile_res))
R_file_stamp := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/R.stamp
include $(BUILD_SYSTEM)/android_manifest.mk
@@ -117,7 +118,7 @@ ifneq ($(full_classes_jar),)
$(full_classes_compiled_jar): $(R_file_stamp)
endif
-endif # $(all_resources) not empty
+endif # need_compile_res
# Reset internal variables.
all_res_assets :=