Allow LOCAL_ASSET_DIR point to nonexistent dir
LOCAL_ASSET_DIR may point to a dir generated during the build process. We have done similiar things to LOCAL_RESOURCE_DIR. Change-Id: Id53433c0d3a4c7af601283755199fde6a59cdfaf
This commit is contained in:
@@ -78,8 +78,11 @@ ifeq ($(filter tests, $(LOCAL_MODULE_TAGS)),)
|
|||||||
LOCAL_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) -z
|
LOCAL_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) -z
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
need_compile_asset :=
|
||||||
ifeq (,$(LOCAL_ASSET_DIR))
|
ifeq (,$(LOCAL_ASSET_DIR))
|
||||||
LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets
|
LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets
|
||||||
|
else
|
||||||
|
need_compile_asset := true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# LOCAL_RESOURCE_DIR may point to resource generated during the build
|
# LOCAL_RESOURCE_DIR may point to resource generated during the build
|
||||||
@@ -101,6 +104,10 @@ LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR)
|
|||||||
all_assets := $(call find-subdir-assets,$(LOCAL_ASSET_DIR))
|
all_assets := $(call find-subdir-assets,$(LOCAL_ASSET_DIR))
|
||||||
all_assets := $(addprefix $(LOCAL_ASSET_DIR)/,$(patsubst assets/%,%,$(all_assets)))
|
all_assets := $(addprefix $(LOCAL_ASSET_DIR)/,$(patsubst assets/%,%,$(all_assets)))
|
||||||
|
|
||||||
|
ifneq ($(all_assets),)
|
||||||
|
need_compile_asset := true
|
||||||
|
endif
|
||||||
|
|
||||||
all_resources := $(strip \
|
all_resources := $(strip \
|
||||||
$(foreach dir, $(LOCAL_RESOURCE_DIR), \
|
$(foreach dir, $(LOCAL_RESOURCE_DIR), \
|
||||||
$(addprefix $(dir)/, \
|
$(addprefix $(dir)/, \
|
||||||
@@ -119,7 +126,7 @@ all_res_assets := $(strip $(all_assets) $(all_resources))
|
|||||||
package_expected_intermediates_COMMON := $(call local-intermediates-dir,COMMON)
|
package_expected_intermediates_COMMON := $(call local-intermediates-dir,COMMON)
|
||||||
# If no assets or resources were found, clear the directory variables so
|
# If no assets or resources were found, clear the directory variables so
|
||||||
# we don't try to build them.
|
# we don't try to build them.
|
||||||
ifeq (,$(all_assets))
|
ifneq (true,$(need_compile_asset))
|
||||||
LOCAL_ASSET_DIR:=
|
LOCAL_ASSET_DIR:=
|
||||||
endif
|
endif
|
||||||
ifneq (true,$(need_compile_res))
|
ifneq (true,$(need_compile_res))
|
||||||
|
Reference in New Issue
Block a user