From 53c8f9789a2c648fce71e7c180715f3c0a1fbf78 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 28 Sep 2018 16:19:42 -0700 Subject: [PATCH] Fix PDK builds $OUT/obj/APPS/SystemUI_intermediates/package.dex.apk was not being written after being converted to Soong. Add a copy rule for it to soong_app_prebuilt.mk, add it as an implicit output to the Make rules that create it, and add it as a real dependency to the platform.zip rules. Test: m platform Change-Id: I96f58d3d80b764a51a6acb87e92498589cfe5c18 --- core/Makefile | 5 ++++- core/package_internal.mk | 6 +++++- core/prebuilt_internal.mk | 3 +++ core/soong_app_prebuilt.mk | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/core/Makefile b/core/Makefile index 042936237..526247524 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2026,6 +2026,7 @@ stnod: systemtarball-nodeps ## PDK_PLATFORM_ZIP_PRODUCT_BINARIES is used to store specified files to platform.zip. ## The variable will be typically set from BoardConfig.mk. ## Files under out dir will be rejected to prevent possible conflicts with other rules. +ifneq (,$(BUILD_PLATFORM_ZIP)) pdk_odex_javalibs := $(strip $(foreach m,$(DEXPREOPT.MODULES.JAVA_LIBRARIES),\ $(if $(filter $(DEXPREOPT.$(m).INSTALLED),$(ALL_DEFAULT_INSTALLED_MODULES)),$(m)))) pdk_odex_apps := $(strip $(foreach m,$(DEXPREOPT.MODULES.APPS),\ @@ -2065,7 +2066,7 @@ INSTALLED_PLATFORM_ZIP := $(PRODUCT_OUT)/platform.zip $(INSTALLED_PLATFORM_ZIP): PRIVATE_DEX_FILES := $(pdk_classes_dex) $(INSTALLED_PLATFORM_ZIP): PRIVATE_ODEX_CONFIG := $(pdk_odex_config_mk) -$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_SYSTEMIMAGE_FILES) $(pdk_odex_config_mk) +$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_SYSTEMIMAGE_FILES) $(pdk_classes_dex) $(pdk_odex_config_mk) $(call pretty,"Platform zip package: $(INSTALLED_PLATFORM_ZIP)") $(hide) rm -f $@ $(hide) cd $(dir $@) && zip -qryX $(notdir $@) \ @@ -2110,6 +2111,8 @@ ifneq (,$(filter platform platform-java, $(MAKECMDGOALS))) $(call dist-for-goals, platform platform-java, $(INSTALLED_PLATFORM_ZIP)) endif +endif # BUILD_PLATFORM_ZIP + # ----------------------------------------------------------------- ## boot tarball define build-boottarball-target diff --git a/core/package_internal.mk b/core/package_internal.mk index 42539f634..934341564 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -620,11 +620,15 @@ endif # LOCAL_USE_AAPT2 ifdef LOCAL_COMPRESSED_MODULE $(LOCAL_BUILT_MODULE) : $(MINIGZIP) endif +ifneq ($(BUILD_PLATFORM_ZIP),) +$(LOCAL_BUILT_MODULE) : .KATI_IMPLICIT_OUTPUTS := $(dir $(LOCAL_BUILT_MODULE))package.dex.apk +endif +$(LOCAL_BUILT_MODULE): @echo "target Package: $(PRIVATE_MODULE) ($@)" rm -rf $@.parts mkdir -p $@.parts ifeq ($(LOCAL_USE_AAPT2),true) - cp -f $< $@.parts/apk.zip + cp -f $(PRIVATE_RES_PACKAGE) $@.parts/apk.zip else # ! LOCAL_USE_AAPT2 $(call create-assets-package,$@.parts/apk.zip) endif # LOCAL_USE_AAPT2 diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index 7c6af8a0b..9ea29fa53 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -352,6 +352,9 @@ $(built_module) : $(appcompat-files) $(LOCAL_BUILT_MODULE): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE) endif +ifneq ($(BUILD_PLATFORM_ZIP),) +$(built_module) : .KATI_IMPLICIT_OUTPUTS := $(dir $(LOCAL_BUILT_MODULE))package.dex.apk +endif $(built_module) : $(my_prebuilt_src_file) | $(ZIPALIGN) $(SIGNAPK_JAR) $(transform-prebuilt-to-target) $(uncompress-shared-libs) diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk index 68916c0cd..d02cba68d 100644 --- a/core/soong_app_prebuilt.mk +++ b/core/soong_app_prebuilt.mk @@ -62,6 +62,10 @@ java-dex: $(LOCAL_SOONG_DEX_JAR) # defines built_odex along with rule to install odex include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk +ifneq ($(BUILD_PLATFORM_ZIP),) + $(eval $(call copy-one-file,$(LOCAL_SOONG_DEX_JAR),$(dir $(LOCAL_BUILT_MODULE))package.dex.apk)) +endif + ifdef LOCAL_DEX_PREOPT $(built_odex): $(LOCAL_SOONG_DEX_JAR) $(call dexpreopt-one-file,$<,$@)