Move support library dependency munging earlier

The presence of LOCAL_STATIC_ANDROID_LIBRARIES is used early to
decide whether to move resources to overlays, and late to decide
whether to add --auto-add-overlay.  If support_libraries.mk moves
the last LOCAL_STATIC_ANDROID_LIBRARIES value to
LOCAL_STATIC_JAVA_LIBRARIES then the resources will be moved to
overlays but --auto-add-overlay will not be added, causing aapt2
to fail with:
error: resource bool/leanback_outline_clipping_disabled does not override an existing resource.
note: define an <add-resource> tag or use --auto-add-overlay.

Bug: 79481102
Test: m FORCE_AAPT2=true java
Change-Id: Icc67acf23b846bd506a5d397d02ad5775ad0ea1d
This commit is contained in:
Colin Cross 2018-05-17 15:05:47 -07:00
parent 1c3d83b64c
commit 7bc6cab12e
2 changed files with 6 additions and 6 deletions

View File

@ -89,6 +89,9 @@ endif
include $(BUILD_SYSTEM)/force_aapt2.mk
# Process Support Library dependencies.
include $(BUILD_SYSTEM)/support_libraries.mk
package_resource_overlays := $(strip \
$(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \
$(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR)))) \
@ -316,9 +319,6 @@ LOCAL_RESOURCE_DIR := $(data_binding_res_out)
LOCAL_AAPT_FLAGS += --auto-add-overlay --extra-packages com.android.databinding.library
endif # LOCAL_DATA_BINDING
# Process Support Library dependencies.
include $(BUILD_SYSTEM)/support_libraries.mk
# If the module is a compressed module, we don't pre-opt it because its final
# installation location will be the data partition.
ifdef LOCAL_COMPRESSED_MODULE

View File

@ -28,15 +28,15 @@ intermediates.COMMON := $(call local-intermediates-dir,COMMON)
my_res_package :=
# Process Support Library dependencies.
include $(BUILD_SYSTEM)/support_libraries.mk
include $(BUILD_SYSTEM)/force_aapt2.mk
ifdef LOCAL_AAPT2_ONLY
LOCAL_USE_AAPT2 := true
endif
# Process Support Library dependencies.
include $(BUILD_SYSTEM)/support_libraries.mk
# Hack to build static Java library with Android resource
# See bug 5714516
all_resources :=