Fix support libraries dependencies based on Soong modules

Use a list of support library java and android libraries exported
from Soong to rewrite dependencies into the appropriate
LOCAL_STATIC_JAVA_LIBRARIES and LOCAL_STATIC_ANDROID_LIBRARIES.

Bug: 78300023
Test: m checkbuild
Change-Id: I4fd1e563272fcef9238a46cda840210529bd706a
This commit is contained in:
Colin Cross 2018-04-19 14:20:19 -07:00
parent ef27db9f6c
commit ceadbadc5d

View File

@ -27,27 +27,27 @@
# Some projects don't work correctly yet. Allow them to skip resolution. # Some projects don't work correctly yet. Allow them to skip resolution.
ifndef LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES ifndef LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES
# Clear these out so we don't accidentally get old values. # Aggregate all requested Support Library modules.
support_android_deps := requested_support_libs := $(filter $(SUPPORT_LIBRARIES_JARS) $(SUPPORT_LIBRARIES_AARS), \
support_java_deps := $(LOCAL_JAVA_LIBRARIES) $(LOCAL_STATIC_JAVA_LIBRARIES) \
$(LOCAL_SHARED_ANDROID_LIBRARIES) $(LOCAL_STATIC_ANDROID_LIBRARIES))
# Delegate dependency expansion to the Support Library's rules. This will store # Filter the Support Library modules out of the library variables. We don't
# its output in the variables support_android_deps and support_java_deps. # trust developers to get these right, so they will be added back by the
include $(RESOLVE_SUPPORT_LIBRARIES) # build system based on the output of this file and the type of build.
LOCAL_JAVA_LIBRARIES := $(filter-out $(requested_support_libs), \
$(LOCAL_JAVA_LIBRARIES))
LOCAL_STATIC_JAVA_LIBRARIES := $(filter-out $(requested_support_libs), \
$(LOCAL_STATIC_JAVA_LIBRARIES))
LOCAL_SHARED_ANDROID_LIBRARIES := $(filter-out $(requested_support_libs), \
$(LOCAL_SHARED_ANDROID_LIBRARIES))
LOCAL_STATIC_ANDROID_LIBRARIES := $(filter-out $(requested_support_libs), \
$(LOCAL_STATIC_ANDROID_LIBRARIES))
# Everything is static, which simplifies resource handling. Don't write to any LOCAL_STATIC_ANDROID_LIBRARIES := $(strip $(LOCAL_STATIC_ANDROID_LIBRARIES) \
# vars unless we actually have data, since even an empty ANDROID_LIBRARIES var $(filter $(SUPPORT_LIBRARIES_AARS),$(requested_support_libs)))
# requires an AndroidManifest.xml file! LOCAL_STATIC_JAVA_LIBRARIES := $(strip $(LOCAL_STATIC_JAVA_LIBRARIES) \
ifdef support_android_deps $(filter $(SUPPORT_LIBRARIES_JARS),$(requested_support_libs)))
LOCAL_STATIC_ANDROID_LIBRARIES += $(support_android_deps)
endif #support_android_deps
ifdef support_java_deps
LOCAL_STATIC_JAVA_LIBRARIES += $(support_java_deps)
endif #support_java_deps
# We have consumed these values. Clean them up.
support_android_deps :=
support_java_deps :=
endif #LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES endif #LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES
LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES := LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES :=