summaryrefslogtreecommitdiffstats
path: root/core/package_internal.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/package_internal.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/package_internal.mk')
-rw-r--r--core/package_internal.mk18
1 files changed, 13 insertions, 5 deletions
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 0f070b6..d52703a 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -72,8 +72,12 @@ ifeq (,$(LOCAL_ASSET_DIR))
LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets
endif
+# LOCAL_RESOURCE_DIR may point to resource generated during the build
+need_compile_res :=
ifeq (,$(LOCAL_RESOURCE_DIR))
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+else
+ need_compile_res := true
endif
package_resource_overlays := $(strip \
@@ -102,6 +106,10 @@ all_resources := $(strip \
) \
))
+ifneq ($(all_resources),)
+ need_compile_res := true
+endif
+
all_res_assets := $(strip $(all_assets) $(all_resources))
package_expected_intermediates_COMMON := $(call local-intermediates-dir,COMMON)
@@ -110,7 +118,7 @@ package_expected_intermediates_COMMON := $(call local-intermediates-dir,COMMON)
ifeq (,$(all_assets))
LOCAL_ASSET_DIR:=
endif
-ifeq (,$(all_resources))
+ifneq (true,$(need_compile_res))
LOCAL_RESOURCE_DIR:=
R_file_stamp :=
else
@@ -135,9 +143,9 @@ ifeq ($(LOCAL_PROGUARD_ENABLED),disabled)
endif
proguard_options_file :=
ifneq ($(LOCAL_PROGUARD_ENABLED),custom)
-ifneq ($(all_resources),)
+ifeq ($(need_compile_res),true)
proguard_options_file := $(package_expected_intermediates_COMMON)/proguard_options
-endif # all_resources
+endif # need_compile_res
endif # !custom
LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS)
@@ -193,7 +201,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): \
PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK)
endif
-ifneq ($(all_resources),)
+ifeq ($(need_compile_res),true)
# Since we don't know where the real R.java file is going to end up,
# we need to use another file to stand in its place. We'll just
@@ -262,7 +270,7 @@ ifneq ($(full_classes_jar),)
$(full_classes_compiled_jar): $(R_file_stamp)
endif
-endif # all_resources
+endif # need_compile_res
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
# We need to explicitly clear this var so that we don't