diff options
author | Jiyong Park <jiyong@google.com> | 2018-03-07 23:36:18 +0900 |
---|---|---|
committer | Anton Hansson <hansson@google.com> | 2018-04-12 13:50:07 +0100 |
commit | 5c3b0bbcf2df147c09eab0995c0e92c076b9e438 (patch) | |
tree | 150156763d24cbb7dd48f902cd2168d13d4643eb | |
parent | 00382ec1c6bcb94a53f07fc6bfb11385f0312da1 (diff) | |
download | sdk-5c3b0bbcf2df147c09eab0995c0e92c076b9e438.tar.gz |
Mark prebuilt API stubs as java:sdk rather than java:platform
These prebuilt API stubs are used when building the unbundled apps
(TARGET_BUILD_APPS is not empty). However, the prebuilts have been
defined without LOCAL_SDK_VERSION, and as a result, their link-type has
been incorrectly identified as java:platform.
This is causing link-type check warning when building the unbundled
apps. And this warning is going to be promoted to error.
Fixing the error by adding LOCAL_SDK_VERSION := current or <ver> when
defining the prebuilts. Note that the same API stubs that are built from
the source code are already with LOCAL_SDK_VERSION set. This change
eliminates the inconsistency.
Bug: 69899800
Test: m -j ANDROID_BUILD_SPEC=vendor/google/build/app_build_spec.mk
Exempt-From-Owner-Approval: CP from master, approved there.
Change-Id: I828eb1cfc1e14c7d72e2f08da7f68809348946bb
Merged-In: I828eb1cfc1e14c7d72e2f08da7f68809348946bb
(cherry picked from commit 1df92df41119941d8e57e803a1fd5ed4a03d08ef)
-rw-r--r-- | Android.mk | 1 | ||||
-rw-r--r-- | current/Android.mk | 26 | ||||
-rw-r--r-- | org.apache.http.legacy/Android.mk | 2 | ||||
-rw-r--r-- | renderscript/Android.mk | 2 |
4 files changed, 26 insertions, 5 deletions
diff --git a/Android.mk b/Android.mk index 7cd8edbc2..4a8c42c15 100644 --- a/Android.mk +++ b/Android.mk @@ -27,6 +27,7 @@ LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX) LOCAL_BUILT_MODULE_STEM := sdk_v$(1)$(COMMON_JAVA_PACKAGE_SUFFIX) LOCAL_MIN_SDK_VERSION := $(if $(call math_is_number,$(strip $(1))),$(1),$(PLATFORM_JACK_MIN_SDK_VERSION)) LOCAL_UNINSTALLABLE_MODULE := true +LOCAL_SDK_VERSION := current include $(BUILD_PREBUILT) ifneq (,$(wildcard $(LOCAL_PATH)/$(1)/uiautomator.jar)) diff --git a/current/Android.mk b/current/Android.mk index 24f9f7ce7..cfe71d184 100644 --- a/current/Android.mk +++ b/current/Android.mk @@ -22,19 +22,35 @@ LOCAL_PATH := $(call my-dir) # For apps (unbundled) build, replace the typical # make target artifacts with prebuilts. ifneq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) -include $(CLEAR_VARS) - # Set up prebuilts for the core Support Library artifacts. -LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += \ +support_jars := \ $(patsubst $(LOCAL_PATH)/%,%,\ $(shell find $(LOCAL_PATH)/support -name "*.jar")) # Set up prebuilts for Multidex library artifacts. -LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += \ +multidex_jars := \ $(patsubst $(LOCAL_PATH)/%,%,\ $(shell find $(LOCAL_PATH)/multidex -name "*.jar")) -include $(BUILD_MULTI_PREBUILT) +prebuilts := $(foreach jar,$(support_jars) $(multidex_jars),\ + $(basename $(notdir $(jar))):$(jar)) + +define define-prebuilt + $(eval tw := $(subst :, ,$(strip $(1)))) \ + $(eval include $(CLEAR_VARS)) \ + $(eval LOCAL_MODULE := $(word 1,$(tw))) \ + $(eval LOCAL_MODULE_TAGS := optional) \ + $(eval LOCAL_MODULE_CLASS := JAVA_LIBRARIES) \ + $(eval LOCAL_SRC_FILES := $(word 2,$(tw))) \ + $(eval LOCAL_UNINSTALLABLE_MODULE := true) \ + $(eval LOCAL_SDK_VERSION := current) \ + $(eval include $(BUILD_PREBUILT)) +endef + +$(foreach p,$(prebuilts),\ + $(call define-prebuilt,$(p))) + +prebuilts := # Generates the v4, v13, and appcompat libraries with static dependencies. include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/org.apache.http.legacy/Android.mk b/org.apache.http.legacy/Android.mk index ca4660e26..357491756 100644 --- a/org.apache.http.legacy/Android.mk +++ b/org.apache.http.legacy/Android.mk @@ -23,6 +23,8 @@ LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX) LOCAL_BUILT_MODULE_STEM := javalib.jar LOCAL_UNINSTALLABLE_MODULE := true +# 21 as specified at /external/apache-http/Android.mk +LOCAL_SDK_VERSION := 21 include $(BUILD_PREBUILT) endif diff --git a/renderscript/Android.mk b/renderscript/Android.mk index 9d48082c0..2528e43dd 100644 --- a/renderscript/Android.mk +++ b/renderscript/Android.mk @@ -60,6 +60,8 @@ LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE_TAGS := optional LOCAL_MODULE_SUFFIX := .jar LOCAL_UNINSTALLABLE_MODULE := true +# 23 as specified at frameworks/rs/support/Android.mk +LOCAL_SDK_VERSION := 23 include $(BUILD_PREBUILT) |