From 92d921ce24ef083cf4b35b63bb88c634abd3de66 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Thu, 13 Jul 2023 16:40:30 -0700 Subject: [PATCH] Minify the sdk targets Previously, the "sdk" target was a minimal lunch target that only included enough to build the sdk. But the "sdk_" targets redirected to the "sdk_phone_" targets, which are much bigger and capable of building a whole emulator. Building the sdk on products that can build a whole device complicates the rest of the build system (for example, it starts enforcing dexpropt works) Bug: 290798660 Test: m sdk dist sdk_repo device-tests platform_tests on sdk_x86_64-userdebug Change-Id: I76f38cf19172a5f5fae423175d5e03670137a0df --- core/soong_app_prebuilt.mk | 4 +++- target/product/sdk.mk | 7 ++----- target/product/sdk_arm64.mk | 7 +++++-- target/product/sdk_x86.mk | 9 ++++++--- target/product/sdk_x86_64.mk | 10 ++++++++-- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk index ccc54494f7..593dfa0569 100644 --- a/core/soong_app_prebuilt.mk +++ b/core/soong_app_prebuilt.mk @@ -73,12 +73,14 @@ endif # We skip it for unbundled app builds where we cannot build veridex. module_run_appcompat := ifeq (true,$(non_system_module)) -ifeq (,$(TARGET_BUILD_APPS)) # ! unbundled app build +ifeq (,$(TARGET_BUILD_APPS)) # not unbundled app build +ifeq (,$(filter sdk,$(MAKECMDGOALS))) # not sdk build (which is another form of unbundled build) ifneq ($(UNSAFE_DISABLE_HIDDENAPI_FLAGS),true) module_run_appcompat := true endif endif endif +endif ifeq ($(module_run_appcompat),true) $(LOCAL_BUILT_MODULE): $(appcompat-files) diff --git a/target/product/sdk.mk b/target/product/sdk.mk index fa7e1ad381..e4cb7ff4fb 100644 --- a/target/product/sdk.mk +++ b/target/product/sdk.mk @@ -14,11 +14,8 @@ # limitations under the License. # -# This is a simple product that uses configures the minimum amount -# needed to build the SDK (without the emulator). +# Don't modify this file - It's just an alias! -$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_x86.mk) PRODUCT_NAME := sdk -PRODUCT_BRAND := Android -PRODUCT_DEVICE := mainline_x86 diff --git a/target/product/sdk_arm64.mk b/target/product/sdk_arm64.mk index 8bb38f41a1..497f673282 100644 --- a/target/product/sdk_arm64.mk +++ b/target/product/sdk_arm64.mk @@ -14,8 +14,11 @@ # limitations under the License. # -# Don't modify this file - It's just an alias! +$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_arm64.mk) +TARGET_SUPPORTS_32_BIT_APPS := true +TARGET_SUPPORTS_64_BIT_APPS := true PRODUCT_NAME := sdk_arm64 +PRODUCT_BRAND := Android +PRODUCT_DEVICE := mainline_arm64 diff --git a/target/product/sdk_x86.mk b/target/product/sdk_x86.mk index 13ee57d805..843321f73b 100644 --- a/target/product/sdk_x86.mk +++ b/target/product/sdk_x86.mk @@ -14,8 +14,11 @@ # limitations under the License. # -# Don't modify this file - It's just an alias! +# This is a simple product that uses configures the minimum amount +# needed to build the SDK (without the emulator). -$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_x86.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk) -PRODUCT_NAME := sdk_x86 +PRODUCT_NAME := sdk_x86_64 +PRODUCT_BRAND := Android +PRODUCT_DEVICE := mainline_x86 diff --git a/target/product/sdk_x86_64.mk b/target/product/sdk_x86_64.mk index 5f6553e000..c1caf7e5aa 100644 --- a/target/product/sdk_x86_64.mk +++ b/target/product/sdk_x86_64.mk @@ -14,8 +14,14 @@ # limitations under the License. # -# Don't modify this file - It's just an alias! +# This is a simple product that uses configures the minimum amount +# needed to build the SDK (without the emulator). -$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_x86_64.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk) + +TARGET_SUPPORTS_32_BIT_APPS := true +TARGET_SUPPORTS_64_BIT_APPS := true PRODUCT_NAME := sdk_x86_64 +PRODUCT_BRAND := Android +PRODUCT_DEVICE := mainline_x86_64