Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53c8f978 authored by Colin Cross's avatar Colin Cross
Browse files

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
parent cae7ba39
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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
+5 −1
Original line number Diff line number Diff line
@@ -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
+3 −0
Original line number Diff line number Diff line
@@ -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)
+4 −0
Original line number Diff line number Diff line
@@ -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,$<,$@)