diff --git a/core/base_rules.mk b/core/base_rules.mk index 38c2c10708..249ecba1cc 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -226,7 +226,8 @@ endif aidl_preprocess_import := LOCAL_SDK_VERSION:=$(strip $(LOCAL_SDK_VERSION)) ifdef LOCAL_SDK_VERSION -ifeq ($(LOCAL_SDK_VERSION),current) +ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current) + # LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS aidl_preprocess_import := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl else aidl_preprocess_import := $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_VERSION)/framework.aidl @@ -399,7 +400,8 @@ ifeq ($(my_prefix),TARGET_) ifeq ($(LOCAL_SDK_VERSION),) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,core) else -ifeq ($(LOCAL_SDK_VERSION),current) +ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current) +# LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS. $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,android_stubs_current) else $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,sdk_v$(LOCAL_SDK_VERSION)) diff --git a/core/droiddoc.mk b/core/droiddoc.mk index 47f599dfb8..e31296541d 100644 --- a/core/droiddoc.mk +++ b/core/droiddoc.mk @@ -64,7 +64,8 @@ endif ifneq ($(LOCAL_IS_HOST_MODULE),true) ifneq ($(LOCAL_SDK_VERSION),) - ifeq ($(LOCAL_SDK_VERSION),current) + ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current) + # Use android_stubs_current if LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS. LOCAL_JAVA_LIBRARIES := android_stubs_current $(LOCAL_JAVA_LIBRARIES) else LOCAL_JAVA_LIBRARIES := sdk_v$(LOCAL_SDK_VERSION) $(LOCAL_JAVA_LIBRARIES) diff --git a/core/java.mk b/core/java.mk index 4005ce3a1e..7e4af79106 100644 --- a/core/java.mk +++ b/core/java.mk @@ -28,7 +28,8 @@ ifneq ($(LOCAL_SDK_VERSION),) $(error $(LOCAL_PATH): Invalid LOCAL_SDK_VERSION '$(LOCAL_SDK_VERSION)' \ Choices are: $(TARGET_AVAILABLE_SDK_VERSIONS)) else - ifeq ($(LOCAL_SDK_VERSION),current) + ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current) + # Use android_stubs_current if LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS. LOCAL_JAVA_LIBRARIES := android_stubs_current $(LOCAL_JAVA_LIBRARIES) else LOCAL_JAVA_LIBRARIES := sdk_v$(LOCAL_SDK_VERSION) $(LOCAL_JAVA_LIBRARIES) @@ -166,7 +167,8 @@ renderscript_flags := -Wall -Werror renderscript_flags += $(LOCAL_RENDERSCRIPT_FLAGS) # prepend the RenderScript system include path -ifneq ($(filter-out current,$(LOCAL_SDK_VERSION)),) +ifneq ($(filter-out current,$(LOCAL_SDK_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current,$(LOCAL_SDK_VERSION))),) +# if a numeric LOCAL_SDK_VERSION, or current LOCAL_SDK_VERSION with TARGET_BUILD_APPS LOCAL_RENDERSCRIPT_INCLUDES := \ $(HISTORICAL_SDK_VERSIONS_ROOT)/renderscript/clang-include \ $(HISTORICAL_SDK_VERSIONS_ROOT)/renderscript/include \ diff --git a/core/package.mk b/core/package.mk index def715fd1f..195b346d37 100644 --- a/core/package.mk +++ b/core/package.mk @@ -267,7 +267,7 @@ else # Most packages should link against the resources defined by framework-res. # Even if they don't have their own resources, they may use framework # resources. -ifneq ($(filter-out current,$(LOCAL_SDK_RES_VERSION)),) +ifneq ($(filter-out current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter 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 diff --git a/core/static_java_library.mk b/core/static_java_library.mk index 91650503af..367ea5f953 100644 --- a/core/static_java_library.mk +++ b/core/static_java_library.mk @@ -64,7 +64,7 @@ framework_res_package_export := framework_res_package_export_deps := # Please refer to package.mk ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) -ifneq ($(filter-out current,$(LOCAL_SDK_RES_VERSION)),) +ifneq ($(filter-out current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current,$(LOCAL_SDK_RES_VERSION))),) framework_res_package_export := \ $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_RES_VERSION)/android.jar framework_res_package_export_deps := $(framework_res_package_export)