diff --git a/core/config.mk b/core/config.mk index b07e9c25d..9e6129017 100644 --- a/core/config.mk +++ b/core/config.mk @@ -960,6 +960,10 @@ else SUPPORT_LIBRARY_ROOT := frameworks/support endif +get-sdk-version = $(if $(findstring _,$(1)),$(subst core_,,$(subst system_,,$(subst test_,,$(1)))),$(1)) +get-sdk-api = $(if $(findstring _,$(1)),$(patsubst %_$(call get-sdk-version,$(1)),%,$(1)),public) +get-prebuilt-sdk-dir = $(HISTORICAL_SDK_VERSIONS_ROOT)/$(call get-sdk-version,$(1))/$(call get-sdk-api,$(1)) + # Resolve LOCAL_SDK_VERSION to prebuilt module name, e.g.: # 23 -> sdk_public_23_android # system_current -> sdk_system_current_android @@ -971,11 +975,13 @@ $(if $(findstring _,$(1)),\ sdk_public_$(1)_$(or $(2),android)) endef +# Resolve LOCAL_SDK_VERSION to prebuilt android.jar +# $(1): LOCAL_SDK_VERSION +resolve-prebuilt-sdk-jar-path = $(call get-prebuilt-sdk-dir,$(1))/android.jar + # Resolve LOCAL_SDK_VERSION to prebuilt framework.aidl # $(1): An sdk version (LOCAL_SDK_VERSION) -define resolve-prebuilt-aidl-path -$(HISTORICAL_SDK_VERSIONS_ROOT)/$(subst core_,,$(subst system_,,$(subst test_,,$(1))))/public/framework.aidl -endef +resolve-prebuilt-sdk-aidl-path = $(call get-prebuilt-sdk-dir,$(call get-sdk-version,$(1)))/framework.aidl # Historical SDK version N is stored in $(HISTORICAL_SDK_VERSIONS_ROOT)/N. # The 'current' version is whatever this source tree is. diff --git a/core/java.mk b/core/java.mk index 94b7bcb70..ad9c71f59 100644 --- a/core/java.mk +++ b/core/java.mk @@ -120,7 +120,7 @@ ifneq ($(filter current system_current test_current core_current, $(LOCAL_SDK_VE # LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS aidl_preprocess_import := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl else - aidl_preprocess_import := $(call resolve-prebuilt-aidl-path,$(LOCAL_SDK_VERSION)) + aidl_preprocess_import := $(call resolve-prebuilt-sdk-aidl-path,$(LOCAL_SDK_VERSION)) endif # not current or system_current else # build against the platform. diff --git a/core/package_internal.mk b/core/package_internal.mk index fba50a167..ac4b53c49 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -486,7 +486,7 @@ ifeq ($(LOCAL_SDK_RES_VERSION),core_current) else ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) # for released sdk versions, the platform resources were built into android.jar. framework_res_package_export := \ - $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_RES_VERSION)/android.jar + $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) else # LOCAL_SDK_RES_VERSION framework_res_package_export := \ $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index ad081d567..8aa5b969a 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -627,7 +627,7 @@ framework_res_package_export := ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) framework_res_package_export := \ - $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_RES_VERSION)/android.jar + $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) else framework_res_package_export := \ $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk diff --git a/core/static_java_library.mk b/core/static_java_library.mk index 7edf2e2ad..a3f560ce8 100644 --- a/core/static_java_library.mk +++ b/core/static_java_library.mk @@ -107,7 +107,7 @@ framework_res_package_export := ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) framework_res_package_export := \ - $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_RES_VERSION)/android.jar + $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) else framework_res_package_export := \ $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk