sdk lib name can be in LOCAL_[STATIC_]JAVA_LIBRARIES

When an sdk lib name (a module defined with java_sdk_library{...}) is
listed in LOCAL_JAVA_LIBRARIES or LOCAL_STATIC_JAVA_LIBRARIES, the name
is translated to the stubs lib name of the sdk lib.

We have to support this at least until all existing references to sdk
libs are all correctly converted to LOCAL_SDK_LIBRARIES.

Bug: 77575606
Test: m -j
Change-Id: I8cff668afd6b5f265cc7ae6fe6f5fa36b76b8334
This commit is contained in:
Jiyong Park 2018-04-27 16:21:00 +09:00
parent 6023db8844
commit cd06fe34e0
1 changed files with 8 additions and 0 deletions

View File

@ -232,6 +232,11 @@ my_system_modules :=
ifndef LOCAL_IS_HOST_MODULE
sdk_libs :=
# When an sdk lib name is listed in LOCAL_JAVA_LIBRARIES, move it to LOCAL_SDK_LIBRARIES, so that
# it is correctly redirected to the stubs library.
LOCAL_SDK_LIBRARIES += $(filter $(JAVA_SDK_LIBRARIES),$(LOCAL_JAVA_LIBRARIES))
LOCAL_JAVA_LIBRARIES := $(filter-out $(JAVA_SDK_LIBRARIES),$(LOCAL_JAVA_LIBRARIES))
ifeq ($(LOCAL_SDK_VERSION),)
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
# No bootclasspath. But we still need "" to prevent javac from using default host bootclasspath.
@ -245,6 +250,9 @@ ifndef LOCAL_IS_HOST_MODULE
LOCAL_JAVA_LIBRARIES := $(filter-out $(TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES) $(TARGET_DEFAULT_JAVA_LIBRARIES),$(LOCAL_JAVA_LIBRARIES))
my_system_modules := $(DEFAULT_SYSTEM_MODULES)
endif # LOCAL_NO_STANDARD_LIBRARIES
# When SDK libraries are referenced from modules built without SDK, provide the system stub to them
# because it has the largest API surface.
sdk_libs := $(foreach lib_name,$(LOCAL_SDK_LIBRARIES),$(lib_name).stubs.system)
else
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
$(call pretty-error,Must not define both LOCAL_NO_STANDARD_LIBRARIES and LOCAL_SDK_VERSION)