forked from openkylin/platform_build
Move screen density config from PRODUCT_LOCALES to PRODUCT_AAPT_CONFIG
With this change, PRODUCT_LOCALES will contain only locales. Other aapt config flags, such as *dpi, small/normal/large/xlarge, should go to PRODUCT_AAPT_CONFIGS. Bug: 4086309 Change-Id: I922f153d79777a9522c542a3907111193b40e7b7
This commit is contained in:
parent
374b3256d2
commit
4f1ab92aac
|
@ -117,13 +117,13 @@ else
|
|||
building_sdk :=
|
||||
endif
|
||||
|
||||
# A change in the list of locales warrants an installclean, too.
|
||||
locale_list := $(subst $(space),$(comma),$(strip $(PRODUCT_LOCALES)))
|
||||
# A change in the list of aapt configs warrants an installclean, too.
|
||||
aapt_config_list := $(strip $(PRODUCT_AAPT_CONFIG))
|
||||
|
||||
current_build_config := \
|
||||
$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)$(building_sdk)-{$(locale_list)}
|
||||
$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)$(building_sdk)-{$(aapt_config_list)}
|
||||
building_sdk :=
|
||||
locale_list :=
|
||||
aapt_config_list :=
|
||||
force_installclean := false
|
||||
|
||||
# Read the current state from the file, if present.
|
||||
|
|
|
@ -1322,12 +1322,12 @@ endef
|
|||
# Maybe we should just use approach (1).
|
||||
|
||||
# This rule creates the R.java and Manifest.java files, both of which
|
||||
# are PRODUCT-neutral. Don't pass PRODUCT_AAPT_CONFIG to this invocation.
|
||||
# are PRODUCT-neutral. Don't pass PRIVATE_PRODUCT_AAPT_CONFIG to this invocation.
|
||||
define create-resource-java-files
|
||||
@mkdir -p $(PRIVATE_SOURCE_INTERMEDIATES_DIR)
|
||||
@mkdir -p $(dir $(PRIVATE_RESOURCE_PUBLICS_OUTPUT))
|
||||
$(hide) $(AAPT) package $(PRIVATE_AAPT_FLAGS) -m \
|
||||
$(eval # PRODUCT_AAPT_CONFIG is intentionally missing-- see comment.) \
|
||||
$(eval # PRIVATE_PRODUCT_AAPT_CONFIG is intentionally missing-- see comment.) \
|
||||
$(addprefix -J , $(PRIVATE_SOURCE_INTERMEDIATES_DIR)) \
|
||||
$(addprefix -M , $(PRIVATE_ANDROID_MANIFEST)) \
|
||||
$(addprefix -P , $(PRIVATE_RESOURCE_PUBLICS_OUTPUT)) \
|
||||
|
@ -1539,7 +1539,7 @@ endef
|
|||
#them in their manifest.
|
||||
define add-assets-to-package
|
||||
$(hide) $(AAPT) package -u $(PRIVATE_AAPT_FLAGS) \
|
||||
$(addprefix -c , $(PRODUCT_AAPT_CONFIG)) \
|
||||
$(addprefix -c , $(PRIVATE_PRODUCT_AAPT_CONFIG)) \
|
||||
$(addprefix -M , $(PRIVATE_ANDROID_MANIFEST)) \
|
||||
$(addprefix -S , $(PRIVATE_RESOURCE_DIR)) \
|
||||
$(addprefix -A , $(PRIVATE_ASSET_DIR)) \
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
##
|
||||
## Additional inputs from base_rules.make:
|
||||
## LOCAL_PACKAGE_NAME: The name of the package; the directory
|
||||
## will be called this.
|
||||
## will be called this.
|
||||
##
|
||||
## MODULE, MODULE_PATH, and MODULE_SUFFIX will
|
||||
## be set for you.
|
||||
|
@ -214,7 +214,7 @@ $(R_file_stamp): $(resource_export_package)
|
|||
|
||||
# add-assets-to-package looks at PRODUCT_AAPT_CONFIG, but this target
|
||||
# can't know anything about PRODUCT. Clear it out just for this target.
|
||||
$(resource_export_package): PRODUCT_AAPT_CONFIG :=
|
||||
$(resource_export_package): PRIVATE_PRODUCT_AAPT_CONFIG :=
|
||||
$(resource_export_package): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_stamp) $(AAPT)
|
||||
@echo "target Export Resources: $(PRIVATE_MODULE) ($@)"
|
||||
$(create-empty-package)
|
||||
|
@ -330,7 +330,9 @@ ifneq ($(TARGET_BUILD_APPS),)
|
|||
LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true
|
||||
endif
|
||||
ifeq ($(LOCAL_AAPT_INCLUDE_ALL_RESOURCES),true)
|
||||
$(LOCAL_BUILT_MODULE): PRODUCT_AAPT_CONFIG :=
|
||||
$(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG :=
|
||||
else
|
||||
$(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := $(PRODUCT_AAPT_CONFIG)
|
||||
endif
|
||||
$(LOCAL_BUILT_MODULE): $(all_res_assets) $(jni_shared_libraries) $(full_android_manifest)
|
||||
@echo "target Package: $(PRIVATE_MODULE) ($@)"
|
||||
|
|
|
@ -63,6 +63,7 @@ _product_var_list := \
|
|||
PRODUCT_NAME \
|
||||
PRODUCT_MODEL \
|
||||
PRODUCT_LOCALES \
|
||||
PRODUCT_AAPT_CONFIG \
|
||||
PRODUCT_PACKAGES \
|
||||
PRODUCT_DEVICE \
|
||||
PRODUCT_MANUFACTURER \
|
||||
|
|
|
@ -226,17 +226,18 @@ ifneq (,$(extra_locales))
|
|||
extra_locales :=
|
||||
endif
|
||||
|
||||
# Add PRODUCT_LOCALES to PRODUCT_AAPT_CONFIG
|
||||
PRODUCT_AAPT_CONFIG := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_CONFIG))
|
||||
PRODUCT_AAPT_CONFIG := $(PRODUCT_LOCALES) $(PRODUCT_AAPT_CONFIG)
|
||||
|
||||
# Default to medium-density assets.
|
||||
# (Can be overridden in the device config, e.g.: PRODUCT_LOCALES += hdpi)
|
||||
PRODUCT_LOCALES := $(strip \
|
||||
$(PRODUCT_LOCALES) \
|
||||
$(if $(filter %dpi,$(PRODUCT_LOCALES)),,mdpi))
|
||||
# (Can be overridden in the device config, e.g.: PRODUCT_AAPT_CONFIG += hdpi)
|
||||
PRODUCT_AAPT_CONFIG := $(strip \
|
||||
$(PRODUCT_AAPT_CONFIG) \
|
||||
$(if $(filter %dpi,$(PRODUCT_AAPT_CONFIG)),,mdpi))
|
||||
|
||||
# Everyone gets nodpi assets which are density-independent.
|
||||
PRODUCT_LOCALES += nodpi
|
||||
|
||||
# Assemble the list of options.
|
||||
PRODUCT_AAPT_CONFIG := $(PRODUCT_LOCALES)
|
||||
PRODUCT_AAPT_CONFIG += nodpi
|
||||
|
||||
# Convert spaces to commas.
|
||||
comma := ,
|
||||
|
|
Loading…
Reference in New Issue