diff --git a/core/config.mk b/core/config.mk index d0a4af53c..6ca09f0a7 100644 --- a/core/config.mk +++ b/core/config.mk @@ -927,8 +927,8 @@ TARGET_AVAILABLE_SDK_VERSIONS := $(addprefix system_,$(call numerically_sort,\ $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/android_system.jar)))) \ $(TARGET_AVAILABLE_SDK_VERSIONS) -# We don't have prebuilt test_current SDK yet. -TARGET_AVAILABLE_SDK_VERSIONS := test_current $(TARGET_AVAILABLE_SDK_VERSIONS) +# We don't have prebuilt test_current and core_current SDK yet. +TARGET_AVAILABLE_SDK_VERSIONS := test_current core_current $(TARGET_AVAILABLE_SDK_VERSIONS) TARGET_SDK_VERSIONS_WITHOUT_JAVA_18_SUPPORT := $(call numbers_less_than,24,$(TARGET_AVAILABLE_SDK_VERSIONS)) TARGET_SDK_VERSIONS_WITHOUT_JAVA_19_SUPPORT := $(call numbers_less_than,27,$(TARGET_AVAILABLE_SDK_VERSIONS)) diff --git a/core/dpi_specific_apk.mk b/core/dpi_specific_apk.mk index e29cde720..f32daf500 100644 --- a/core/dpi_specific_apk.mk +++ b/core/dpi_specific_apk.mk @@ -18,7 +18,7 @@ $(built_dpi_apk): PRIVATE_RESOURCE_DIR := $(LOCAL_RESOURCE_DIR) $(built_dpi_apk): PRIVATE_ASSET_DIR := $(LOCAL_ASSET_DIR) $(built_dpi_apk): PRIVATE_AAPT_INCLUDES := $(all_library_res_package_exports) $(built_dpi_apk): PRIVATE_RESOURCE_LIST := $(all_res_assets) -ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION))) +ifneq (,$(filter-out current system_current test_current core_current, $(LOCAL_SDK_VERSION))) $(built_dpi_apk): PRIVATE_DEFAULT_APP_TARGET_SDK := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION)) else $(built_dpi_apk): PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK) diff --git a/core/droiddoc.mk b/core/droiddoc.mk index 176a01d36..04eb78eea 100644 --- a/core/droiddoc.mk +++ b/core/droiddoc.mk @@ -71,6 +71,9 @@ ifneq ($(LOCAL_SDK_VERSION),) else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),test_current) LOCAL_JAVA_LIBRARIES := android_test_stubs_current $(LOCAL_JAVA_LIBRARIES) $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_test_stubs_current) + else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),core_current) + LOCAL_JAVA_LIBRARIES := core.current.stubs $(LOCAL_JAVA_LIBRARIES) + $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, core.current.stubs) else ifneq (,$(call has-system-sdk-version,$(LOCAL_SDK_VERSION))) ifeq (,$(TARGET_BUILD_APPS)) @@ -81,8 +84,12 @@ ifneq ($(LOCAL_SDK_VERSION),) $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, sdk_v$(LOCAL_SDK_VERSION)) endif else - LOCAL_JAVA_LIBRARIES := sdk_v$(LOCAL_SDK_VERSION) $(LOCAL_JAVA_LIBRARIES) - $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, sdk_v$(LOCAL_SDK_VERSION)) + # core_ is subset of . Instead of defining a prebuilt lib for core_, + # use the stub for when building for apps. + _version := $(patsubst core_%,%,$(LOCAL_SDK_VERSION)) + LOCAL_JAVA_LIBRARIES := sdk_v$(_version) $(LOCAL_JAVA_LIBRARIES) + $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, sdk_v$(_version)) + _version := endif endif else diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk index 1ff9b91f3..7bae6968c 100644 --- a/core/host_dalvik_java_library.mk +++ b/core/host_dalvik_java_library.mk @@ -193,7 +193,7 @@ $(LOCAL_BUILT_MODULE): $(built_dex) $(java_resource_sources) endif # !LOCAL_IS_STATIC_JAVA_LIBRARY -ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION))) +ifneq (,$(filter-out current system_current test_current core_current, $(LOCAL_SDK_VERSION))) my_default_app_target_sdk := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION)) my_sdk_version := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION)) else diff --git a/core/java.mk b/core/java.mk index ee071c932..773989849 100644 --- a/core/java.mk +++ b/core/java.mk @@ -124,7 +124,7 @@ ifneq (,$(LOCAL_RENDERSCRIPT_TARGET_API)) else ifneq (,$(LOCAL_SDK_VERSION)) # Set target-api for LOCAL_SDK_VERSIONs other than current. - ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION))) + ifneq (,$(filter-out current system_current test_current core_current, $(LOCAL_SDK_VERSION))) renderscript_target_api := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION)) endif endif # LOCAL_SDK_VERSION is set @@ -149,7 +149,7 @@ renderscript_flags := -Wall -Werror renderscript_flags += $(LOCAL_RENDERSCRIPT_FLAGS) # prepend the RenderScript system include path -ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_VERSION))),) +ifneq ($(filter-out current system_current test_current core_current,$(LOCAL_SDK_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_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 \ @@ -265,7 +265,7 @@ ifneq ($(strip $(aidl_sources)),) aidl_preprocess_import := ifdef LOCAL_SDK_VERSION -ifneq ($(filter current system_current test_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS)),) +ifneq ($(filter current system_current test_current core_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS)),) # LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS aidl_preprocess_import := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl else @@ -609,7 +609,7 @@ proguard_dictionary := $(intermediates.COMMON)/proguard_dictionary my_proguard_sdk_raise := ifdef LOCAL_SDK_VERSION ifdef TARGET_BUILD_APPS -ifeq (,$(filter current system_current test_current, $(LOCAL_SDK_VERSION))) +ifeq (,$(filter current system_current test_current core_current, $(LOCAL_SDK_VERSION))) my_proguard_sdk_raise := $(call java-lib-header-files, sdk_vcurrent) endif else @@ -798,7 +798,7 @@ $(LOCAL_MODULE)-findbugs : $(findbugs_html) endif # full_classes_jar is defined -ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION))) +ifneq (,$(filter-out current system_current test_current core_current, $(LOCAL_SDK_VERSION))) my_default_app_target_sdk := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION)) my_sdk_version := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION)) else diff --git a/core/java_common.mk b/core/java_common.mk index ac8b0d2dd..2c141f74d 100644 --- a/core/java_common.mk +++ b/core/java_common.mk @@ -258,6 +258,8 @@ ifndef LOCAL_IS_HOST_MODULE full_java_bootclasspath_libs := $(call java-lib-header-files,android_system_stubs_current) else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),test_current) full_java_bootclasspath_libs := $(call java-lib-header-files,android_test_stubs_current) + else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),core_current) + full_java_bootclasspath_libs := $(call java-lib-header-files,core.current.stubs) else ifneq (,$(call has-system-sdk-version,$(LOCAL_SDK_VERSION))) ifeq (,$(TARGET_BUILD_APPS)) @@ -266,9 +268,13 @@ ifndef LOCAL_IS_HOST_MODULE full_java_bootclasspath_libs := $(call java-lib-header-files,sdk_v$(LOCAL_SDK_VERSION)) endif else - full_java_bootclasspath_libs := $(call java-lib-header-files,sdk_v$(LOCAL_SDK_VERSION)) + # core_ is subset of . Instead of defining a prebuilt lib for core_, + # use the stub for when building for apps. + _version := $(patsubst core_%,%,$(LOCAL_SDK_VERSION)) + full_java_bootclasspath_libs := $(call java-lib-header-files,sdk_v$(_version)) + _version := endif - endif # current, system_current, system_${VER} or test_current + endif # current, system_current, system_${VER}, test_current or core_current endif # LOCAL_SDK_VERSION ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) @@ -460,19 +466,23 @@ ifndef LOCAL_IS_HOST_MODULE ifeq ($(LOCAL_SDK_VERSION),system_current) my_link_type := java:system my_warn_types := java:platform -my_allowed_types := java:sdk java:system +my_allowed_types := java:sdk java:system java:core else ifneq (,$(call has-system-sdk-version,$(LOCAL_SDK_VERSION))) my_link_type := java:system my_warn_types := java:platform -my_allowed_types := java:sdk java:system +my_allowed_types := java:sdk java:system java:core +else ifeq ($(LOCAL_SDK_VERSION),core_current) +my_link_type := java:core +my_warn_types := +my_allowed_types := java:core else ifneq ($(LOCAL_SDK_VERSION),) my_link_type := java:sdk my_warn_types := java:system java:platform -my_allowed_types := java:sdk +my_allowed_types := java:sdk java:core else my_link_type := java:platform my_warn_types := -my_allowed_types := java:sdk java:system java:platform +my_allowed_types := java:sdk java:system java:platform java:core endif ifdef LOCAL_AAPT2_ONLY diff --git a/core/package_internal.mk b/core/package_internal.mk index 489096635..d7944bb0e 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -394,7 +394,7 @@ renderscript_target_api := $(LOCAL_RENDERSCRIPT_TARGET_API) else ifneq (,$(LOCAL_SDK_VERSION)) # Set target-api for LOCAL_SDK_VERSIONs other than current. -ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION))) +ifneq (,$(filter-out current system_current test_current core_current, $(LOCAL_SDK_VERSION))) renderscript_target_api := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION)) endif endif # LOCAL_SDK_VERSION is set diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index ea7fd0383..cb1d4016d 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -546,6 +546,8 @@ ifeq ($(LOCAL_SDK_VERSION),system_current) my_link_type := java:system else ifneq (,$(call has-system-sdk-version,$(LOCAL_SDK_VERSION))) my_link_type := java:system +else ifeq ($(LOCAL_SDK_VERSION),core_current) +my_link_type := java:core else ifneq ($(LOCAL_SDK_VERSION),) my_link_type := java:sdk else diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk index 65aabffa9..c553c4c41 100644 --- a/core/soong_app_prebuilt.mk +++ b/core/soong_app_prebuilt.mk @@ -78,15 +78,15 @@ ifndef LOCAL_IS_HOST_MODULE ifeq ($(LOCAL_SDK_VERSION),system_current) my_link_type := java:system my_warn_types := java:platform -my_allowed_types := java:sdk java:system +my_allowed_types := java:sdk java:system java:core else ifneq ($(LOCAL_SDK_VERSION),) my_link_type := java:sdk my_warn_types := java:system java:platform -my_allowed_types := java:sdk +my_allowed_types := java:sdk java:core else my_link_type := java:platform my_warn_types := -my_allowed_types := java:sdk java:system java:platform +my_allowed_types := java:sdk java:system java:platform java:core endif my_link_deps := diff --git a/core/soong_java_prebuilt.mk b/core/soong_java_prebuilt.mk index 6cf94229c..cf2fc8e4a 100644 --- a/core/soong_java_prebuilt.mk +++ b/core/soong_java_prebuilt.mk @@ -86,19 +86,23 @@ ifndef LOCAL_IS_HOST_MODULE ifeq ($(LOCAL_SDK_VERSION),system_current) my_link_type := java:system my_warn_types := java:platform -my_allowed_types := java:sdk java:system +my_allowed_types := java:sdk java:system java:core else ifneq (,$(call has-system-sdk-version,$(LOCAL_SDK_VERSION))) my_link_type := java:system my_warn_types := java:platform -my_allowed_types := java:sdk java:system +my_allowed_types := java:sdk java:system java:core +else ifeq ($(LOCAL_SDK_VERSION),core_current) +my_link_type := java:core +my_warn_types := +my_allowed_types := java:core else ifneq ($(LOCAL_SDK_VERSION),) my_link_type := java:sdk my_warn_types := java:system java:platform -my_allowed_types := java:sdk +my_allowed_types := java:sdk java:core else my_link_type := java:platform my_warn_types := -my_allowed_types := java:sdk java:system java:platform +my_allowed_types := java:sdk java:system java:platform java:core endif my_link_deps := diff --git a/core/static_java_library.mk b/core/static_java_library.mk index aa1f0fa14..c1478f10d 100644 --- a/core/static_java_library.mk +++ b/core/static_java_library.mk @@ -156,7 +156,7 @@ renderscript_target_api := $(LOCAL_RENDERSCRIPT_TARGET_API) else ifneq (,$(LOCAL_SDK_VERSION)) # Set target-api for LOCAL_SDK_VERSIONs other than current. -ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION))) +ifneq (,$(filter-out current system_current test_current core_current, $(LOCAL_SDK_VERSION))) renderscript_target_api := $(call get-numeric-sdk-version,$(LOCAL_SDK_VERSION)) endif endif # LOCAL_SDK_VERSION is set