diff --git a/core/android_manifest.mk b/core/android_manifest.mk index 8fab9c6ae..254e09bc9 100644 --- a/core/android_manifest.mk +++ b/core/android_manifest.mk @@ -45,7 +45,7 @@ my_target_sdk_version := $(call module-target-sdk-version) my_min_sdk_version := $(call module-min-sdk-version) ifdef TARGET_BUILD_APPS - ifndef TARGET_BUILD_APPS_USE_PREBUILT_SDK + ifndef TARGET_BUILD_USE_PREBUILT_SDKS ifeq ($(my_target_sdk_version),$(PLATFORM_VERSION_CODENAME)) ifdef UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT my_target_sdk_version := $(my_target_sdk_version).$$(cat $(API_FINGERPRINT)) diff --git a/core/config.mk b/core/config.mk index a35b71835..f9bb873e4 100644 --- a/core/config.mk +++ b/core/config.mk @@ -517,18 +517,23 @@ endif ifeq ($(TARGET_BUILD_PDK),true) ALLOW_MISSING_DEPENDENCIES := true endif +ifeq ($(TARGET_BUILD_UNBUNDLED_IMAGE),true) +ALLOW_MISSING_DEPENDENCIES := true +endif ifneq ($(filter true,$(SOONG_ALLOW_MISSING_DEPENDENCIES)),) ALLOW_MISSING_DEPENDENCIES := true endif .KATI_READONLY := ALLOW_MISSING_DEPENDENCIES -TARGET_BUILD_APPS_USE_PREBUILT_SDK := -ifdef TARGET_BUILD_APPS +TARGET_BUILD_USE_PREBUILT_SDKS := +ifneq (,$(TARGET_BUILD_APPS)$(TARGET_BUILD_UNBUNDLED_IMAGE)) ifndef UNBUNDLED_BUILD_SDKS_FROM_SOURCE - TARGET_BUILD_APPS_USE_PREBUILT_SDK := true + TARGET_BUILD_USE_PREBUILT_SDKS := true endif endif +.KATI_READONLY := TARGET_BUILD_USE_PREBUILT_SDKS + prebuilt_sdk_tools := prebuilts/sdk/tools prebuilt_sdk_tools_bin := $(prebuilt_sdk_tools)/$(HOST_OS)/bin @@ -550,18 +555,18 @@ USE_D8 := true .KATI_READONLY := USE_D8 # -# Tools that are prebuilts for TARGET_BUILD_APPS +# Tools that are prebuilts for TARGET_BUILD_USE_PREBUILT_SDKS # -ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) +ifeq (,$(TARGET_BUILD_USE_PREBUILT_SDKS)$(filter true,$(TARGET_BUILD_PDK))) AAPT := $(HOST_OUT_EXECUTABLES)/aapt MAINDEXCLASSES := $(HOST_OUT_EXECUTABLES)/mainDexClasses -else # TARGET_BUILD_APPS || TARGET_BUILD_PDK +else # TARGET_BUILD_USE_PREBUILT_SDKS || TARGET_BUILD_PDK AAPT := $(prebuilt_sdk_tools_bin)/aapt MAINDEXCLASSES := $(prebuilt_sdk_tools)/mainDexClasses -endif # TARGET_BUILD_APPS || TARGET_BUILD_PDK +endif # TARGET_BUILD_USE_PREBUILT_SDKS || TARGET_BUILD_PDK -ifeq (,$(TARGET_BUILD_APPS)) +ifeq (,$(TARGET_BUILD_USE_PREBUILT_SDKS)) # Use RenderScript prebuilts for unbundled builds but not PDK builds LLVM_RS_CC := $(HOST_OUT_EXECUTABLES)/llvm-rs-cc BCC_COMPAT := $(HOST_OUT_EXECUTABLES)/bcc_compat @@ -1109,7 +1114,7 @@ HISTORICAL_SDK_VERSIONS_ROOT := $(TOPDIR)prebuilts/sdk HISTORICAL_NDK_VERSIONS_ROOT := $(TOPDIR)prebuilts/ndk # The path where app can reference the support library resources. -ifdef TARGET_BUILD_APPS +ifdef TARGET_BUILD_USE_PREBUILT_SDKS SUPPORT_LIBRARY_ROOT := $(HISTORICAL_SDK_VERSIONS_ROOT)/current/support else SUPPORT_LIBRARY_ROOT := frameworks/support diff --git a/core/envsetup.mk b/core/envsetup.mk index f78ecb4f5..167fed947 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -93,6 +93,7 @@ TARGET_BUILD_VARIANT := eng endif TARGET_BUILD_APPS ?= +TARGET_BUILD_UNBUNDLED_IMAGE ?= # Set to true for an unbundled build, i.e. a build without # support for platform targets like the system image. This also @@ -107,11 +108,19 @@ ifneq ($(TARGET_BUILD_APPS),) TARGET_BUILD_UNBUNDLED := true endif +# TARGET_BUILD_UNBUNDLED_IMAGE also implies unbundled build. +# (i.e. it targets to only unbundled image, such as the vendor image, +# ,or the product image). +ifneq ($(TARGET_BUILD_UNBUNDLED_IMAGE),) + TARGET_BUILD_UNBUNDLED := true +endif + .KATI_READONLY := \ TARGET_PRODUCT \ TARGET_BUILD_VARIANT \ TARGET_BUILD_APPS \ TARGET_BUILD_UNBUNDLED \ + TARGET_BUILD_UNBUNDLED_IMAGE \ # --------------------------------------------------------------- # Set up configuration for host machine. We don't do cross- diff --git a/core/java.mk b/core/java.mk index 2f18ad9dd..bb4593df5 100644 --- a/core/java.mk +++ b/core/java.mk @@ -106,8 +106,8 @@ ifneq ($(strip $(aidl_sources)),) aidl_preprocess_import := ifdef LOCAL_SDK_VERSION -ifneq ($(filter current system_current test_current core_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS_USE_PREBUILT_SDK)),) - # LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS +ifneq ($(filter current system_current test_current core_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_USE_PREBUILT_SDKS)),) + # LOCAL_SDK_VERSION is current and no TARGET_BUILD_USE_PREBUILT_SDKS aidl_preprocess_import := $(FRAMEWORK_AIDL) else aidl_preprocess_import := $(call resolve-prebuilt-sdk-aidl-path,$(LOCAL_SDK_VERSION)) diff --git a/core/java_common.mk b/core/java_common.mk index b7f288389..1798ca845 100644 --- a/core/java_common.mk +++ b/core/java_common.mk @@ -25,7 +25,7 @@ ifeq (,$(LOCAL_JAVA_LANGUAGE_VERSION)) LOCAL_JAVA_LANGUAGE_VERSION := 1.7 else ifneq (,$(filter $(LOCAL_SDK_VERSION), $(TARGET_SDK_VERSIONS_WITHOUT_JAVA_19_SUPPORT))) LOCAL_JAVA_LANGUAGE_VERSION := 1.8 - else ifneq (,$(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS_USE_PREBUILT_SDK)) + else ifneq (,$(LOCAL_SDK_VERSION)$(TARGET_BUILD_USE_PREBUILT_SDKS)) # TODO(ccross): allow 1.9 for current and unbundled once we have SDK system modules LOCAL_JAVA_LANGUAGE_VERSION := 1.8 else @@ -268,7 +268,7 @@ ifndef LOCAL_IS_HOST_MODULE my_system_modules := $(LEGACY_CORE_PLATFORM_SYSTEM_MODULES) endif # LOCAL_NO_STANDARD_LIBRARIES - ifneq (,$(TARGET_BUILD_APPS_USE_PREBUILT_SDK)) + ifneq (,$(TARGET_BUILD_USE_PREBUILT_SDKS)) sdk_libs := $(foreach lib_name,$(LOCAL_SDK_LIBRARIES),$(call resolve-prebuilt-sdk-module,system_current,$(lib_name))) else # When SDK libraries are referenced from modules built without SDK, provide the all APIs to them @@ -283,8 +283,8 @@ ifndef LOCAL_IS_HOST_MODULE Choices are: $(TARGET_AVAILABLE_SDK_VERSIONS)) endif - ifneq (,$(TARGET_BUILD_APPS_USE_PREBUILT_SDK)$(filter-out %current,$(LOCAL_SDK_VERSION))) - # TARGET_BUILD_APPS mode or numbered SDK. Use prebuilt modules. + ifneq (,$(TARGET_BUILD_USE_PREBUILT_SDKS)$(filter-out %current,$(LOCAL_SDK_VERSION))) + # TARGET_BUILD_USE_PREBUILT_SDKS mode or numbered SDK. Use prebuilt modules. sdk_module := $(call resolve-prebuilt-sdk-module,$(LOCAL_SDK_VERSION)) sdk_libs := $(foreach lib_name,$(LOCAL_SDK_LIBRARIES),$(call resolve-prebuilt-sdk-module,$(LOCAL_SDK_VERSION),$(lib_name))) else @@ -325,7 +325,7 @@ ifndef LOCAL_IS_HOST_MODULE # related classes to be present. This change adds stubs needed for # javac to compile lambdas. ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) - ifdef TARGET_BUILD_APPS_USE_PREBUILT_SDK + ifdef TARGET_BUILD_USE_PREBUILT_SDKS full_java_bootclasspath_libs += $(call java-lib-header-files,sdk-core-lambda-stubs) else full_java_bootclasspath_libs += $(call java-lib-header-files,core-lambda-stubs) diff --git a/core/java_prebuilt_internal.mk b/core/java_prebuilt_internal.mk index 6ee1ae1d7..279b0e4a9 100644 --- a/core/java_prebuilt_internal.mk +++ b/core/java_prebuilt_internal.mk @@ -173,7 +173,7 @@ endif framework_res_package_export := # Please refer to package.mk 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))),) +ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_USE_PREBUILT_SDKS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) framework_res_package_export := \ $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) else diff --git a/core/java_renderscript.mk b/core/java_renderscript.mk index bfcf59e32..572d6e4a4 100644 --- a/core/java_renderscript.mk +++ b/core/java_renderscript.mk @@ -50,8 +50,8 @@ renderscript_flags := -Wall -Werror renderscript_flags += $(LOCAL_RENDERSCRIPT_FLAGS) # prepend the RenderScript system include path -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 +ifneq ($(filter-out current system_current test_current core_current,$(LOCAL_SDK_VERSION))$(if $(TARGET_BUILD_USE_PREBUILT_SDKS),$(filter current system_current test_current,$(LOCAL_SDK_VERSION))),) +# if a numeric LOCAL_SDK_VERSION, or current LOCAL_SDK_VERSION with TARGET_BUILD_USE_PREBUILT_SDKS LOCAL_RENDERSCRIPT_INCLUDES := \ $(HISTORICAL_SDK_VERSIONS_ROOT)/renderscript/clang-include \ $(HISTORICAL_SDK_VERSIONS_ROOT)/renderscript/include \ @@ -110,7 +110,7 @@ renderscript_intermediate := $(intermediates)/renderscript rs_jni_lib := $(call intermediates-dir-for,SHARED_LIBRARIES,librsjni.so)/librsjni.so LOCAL_JNI_SHARED_LIBRARIES += librsjni -ifneq (,$(TARGET_BUILD_APPS)$(FORCE_BUILD_RS_COMPAT)) +ifneq (,$(TARGET_BUILD_USE_PREBUILT_SDKS)$(FORCE_BUILD_RS_COMPAT)) rs_compatibility_jni_libs := $(addprefix \ $(renderscript_intermediate)/librs., \ diff --git a/core/package_internal.mk b/core/package_internal.mk index 775ee4853..b0588915c 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -401,7 +401,7 @@ ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) # resources. ifeq ($(LOCAL_SDK_RES_VERSION),core_current) # core_current doesn't contain any framework resources. -else ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS_USE_PREBUILT_SDK),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) +else ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_USE_PREBUILT_SDKS),$(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 := \ $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) diff --git a/core/soong_config.mk b/core/soong_config.mk index 98ab07dd9..d923c5695 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -41,7 +41,7 @@ $(call add_json_str, Platform_min_supported_target_sdk_version, $(PLATFORM_MIN_ $(call add_json_bool, Allow_missing_dependencies, $(ALLOW_MISSING_DEPENDENCIES)) $(call add_json_bool, Unbundled_build, $(TARGET_BUILD_UNBUNDLED)) $(call add_json_bool, Unbundled_build_apps, $(TARGET_BUILD_APPS)) -$(call add_json_bool, Unbundled_build_sdks_from_source, $(UNBUNDLED_BUILD_SDKS_FROM_SOURCE)) +$(call add_json_bool, Always_use_prebuilt_sdks, $(TARGET_BUILD_USE_PREBUILT_SDKS)) $(call add_json_bool, Pdk, $(filter true,$(TARGET_BUILD_PDK))) $(call add_json_bool, Debuggable, $(filter userdebug eng,$(TARGET_BUILD_VARIANT))) diff --git a/core/static_java_library.mk b/core/static_java_library.mk index 81dc2dfc4..7a873229d 100644 --- a/core/static_java_library.mk +++ b/core/static_java_library.mk @@ -111,7 +111,7 @@ endif framework_res_package_export := # Please refer to package.mk ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) -ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS_USE_PREBUILT_SDK),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) +ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_USE_PREBUILT_SDKS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) framework_res_package_export := \ $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) else