Remove PRODUCT_AAPT2_CFLAGS and PRODUCT_AAPT_FLAGS

PRODUCT_AAPT2_CFLAGS and PRODUCT_AAPT_FLAGS are only used to pass
--pseudo-localize.  The flag doesn't need to be conditional on the
product, because the pseudo locale will be stripped out later if it
is not wanted.  Having it conditional on the product causes the
AAPT2-compiled resources to vary between products, which causes
unnecessary rebuilds when swithcing products.

Remove the variables, always add --pseudo-localize, and move
the AAPT2 compiled output to the common intermediates.

Test: m checkbuild
Change-Id: Iacc914114616b5bd19d9a1011802f4f9bca9bc19
This commit is contained in:
Colin Cross 2017-10-27 16:10:18 -07:00
parent 0bbd8d9e37
commit d5cce4c360
5 changed files with 7 additions and 12 deletions

View file

@ -442,6 +442,8 @@ $(call add-clean-step, rm -f $(OUT_DIR)/target/common/obj/*/*_intermediates/java
$(call add-clean-step, rm -rf $(OUT_DIR)/host/common/obj/*/*_intermediates/src) $(call add-clean-step, rm -rf $(OUT_DIR)/host/common/obj/*/*_intermediates/src)
$(call add-clean-step, rm -f $(OUT_DIR)/host/common/obj/*/*_intermediates/java-source-list) $(call add-clean-step, rm -f $(OUT_DIR)/host/common/obj/*/*_intermediates/java-source-list)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/*/flat-res)
# ************************************************ # ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************ # ************************************************

View file

@ -47,8 +47,10 @@ $(my_generated_resources_flata) : $(my_generated_res_dirs_deps) $(AAPT2)
my_generated_resources_flata += $(my_generated_resources_flata) my_generated_resources_flata += $(my_generated_resources_flata)
endif endif
# Always set --pseudo-localize, it will be stripped out later for release
# builds that don't want it.
$(my_res_resources_flat) $(my_overlay_resources_flat) $(my_generated_resources_flata): \ $(my_res_resources_flat) $(my_overlay_resources_flat) $(my_generated_resources_flata): \
PRIVATE_AAPT2_CFLAGS := $(PRODUCT_AAPT2_CFLAGS) PRIVATE_AAPT2_CFLAGS := --pseudo-localize
my_static_library_resources := $(foreach l, $(call reverse-list,$(LOCAL_STATIC_ANDROID_LIBRARIES)),\ my_static_library_resources := $(foreach l, $(call reverse-list,$(LOCAL_STATIC_ANDROID_LIBRARIES)),\
$(call intermediates-dir-for,JAVA_LIBRARIES,$(l),,COMMON)/package-res.apk) $(call intermediates-dir-for,JAVA_LIBRARIES,$(l),,COMMON)/package-res.apk)

View file

@ -9,7 +9,7 @@ additional_certificates := $(foreach c,$(LOCAL_ADDITIONAL_CERTIFICATES), $(c).x5
# Set up all the target-specific variables. # Set up all the target-specific variables.
$(built_dpi_apk): PRIVATE_MODULE := $(dpi_apk_name) $(built_dpi_apk): PRIVATE_MODULE := $(dpi_apk_name)
$(built_dpi_apk): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) $(PRODUCT_AAPT_FLAGS) $($(LOCAL_PACKAGE_NAME)_aapt_flags_$(my_dpi)) $(built_dpi_apk): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) --pseudo-localize $($(LOCAL_PACKAGE_NAME)_aapt_flags_$(my_dpi))
# Clear PRIVATE_PRODUCT_AAPT_CONFIG to include everything by default. # Clear PRIVATE_PRODUCT_AAPT_CONFIG to include everything by default.
$(built_dpi_apk): PRIVATE_PRODUCT_AAPT_CONFIG := $(built_dpi_apk): PRIVATE_PRODUCT_AAPT_CONFIG :=
$(built_dpi_apk): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := $(my_dpi) $(built_dpi_apk): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := $(my_dpi)

View file

@ -353,7 +353,7 @@ installed_apk_splits := $(foreach s,$(my_split_suffixes),$(my_module_path)/$(LOC
endif endif
ifdef LOCAL_USE_AAPT2 ifdef LOCAL_USE_AAPT2
my_compiled_res_base_dir := $(intermediates)/flat-res my_compiled_res_base_dir := $(intermediates.COMMON)/flat-res
renderscript_target_api := renderscript_target_api :=
ifneq (,$(LOCAL_RENDERSCRIPT_TARGET_API)) ifneq (,$(LOCAL_RENDERSCRIPT_TARGET_API))
renderscript_target_api := $(LOCAL_RENDERSCRIPT_TARGET_API) renderscript_target_api := $(LOCAL_RENDERSCRIPT_TARGET_API)

View file

@ -295,15 +295,6 @@ PRODUCT_AAPT_CONFIG_SP := $(PRODUCT_AAPT_CONFIG)
PRODUCT_AAPT_CONFIG := \ PRODUCT_AAPT_CONFIG := \
$(subst $(space),$(comma),$(strip $(PRODUCT_AAPT_CONFIG))) $(subst $(space),$(comma),$(strip $(PRODUCT_AAPT_CONFIG)))
# product-scoped aapt flags
PRODUCT_AAPT_FLAGS :=
PRODUCT_AAPT2_CFLAGS :=
ifneq ($(filter en_XA ar_XB,$(PRODUCT_LOCALES)),)
# Force generating resources for pseudo-locales.
PRODUCT_AAPT2_CFLAGS += --pseudo-localize
PRODUCT_AAPT_FLAGS += --pseudo-localize
endif
PRODUCT_BRAND := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BRAND)) PRODUCT_BRAND := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BRAND))
PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MODEL)) PRODUCT_MODEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MODEL))