Merge "Use soong_zip and zip2zip to make dist faster"

This commit is contained in:
Treehugger Robot 2016-08-11 19:28:13 +00:00 committed by Gerrit Code Review
commit 6dcdb45485
2 changed files with 17 additions and 14 deletions

View File

@ -1733,11 +1733,12 @@ $(BUILT_TARGET_FILES_PACKAGE): \
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \ $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
$(SELINUX_FC) \ $(SELINUX_FC) \
$(APKCERTS_FILE) \ $(APKCERTS_FILE) \
$(SOONG_ZIP) \
$(HOST_OUT_EXECUTABLES)/fs_config \ $(HOST_OUT_EXECUTABLES)/fs_config \
build/tools/releasetools/add_img_to_target_files \ build/tools/releasetools/add_img_to_target_files \
| $(ACP) | $(ACP)
@echo "Package target files: $@" @echo "Package target files: $@"
$(hide) rm -rf $@ $(zip_root) $(hide) rm -rf $@ $@.list $(zip_root)
$(hide) mkdir -p $(dir $@) $(zip_root) $(hide) mkdir -p $(dir $@) $(zip_root)
ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))) ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)))
@# Components of the recovery image @# Components of the recovery image
@ -1929,9 +1930,9 @@ ifdef BOARD_PREBUILT_VENDORIMAGE
endif endif
@# Zip everything up, preserving symlinks and placing META/ files first to @# Zip everything up, preserving symlinks and placing META/ files first to
@# help early validation of the .zip file while uploading it. @# help early validation of the .zip file while uploading it.
$(hide) (cd $(zip_root) && \ $(hide) find $(zip_root)/META | sort >$@.list
zip -qryX ../$(notdir $@) ./META && \ $(hide) find $(zip_root) | grep -v "^$(zip_root)/META/" | sort >>$@.list
zip -qryXu ../$(notdir $@) .) $(hide) $(SOONG_ZIP) -d -o $@ -C $(zip_root) -l $@.list
@# Run fs_config on all the system, vendor, boot ramdisk, @# Run fs_config on all the system, vendor, boot ramdisk,
@# and recovery ramdisk files in the zip, and save the output @# and recovery ramdisk files in the zip, and save the output
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="SYSTEM/" } /^SYSTEM\// {print "system/" $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config -C -D $(TARGET_OUT) -S $(SELINUX_FC) > $(zip_root)/META/filesystem_config.txt $(hide) zipinfo -1 $@ | awk 'BEGIN { FS="SYSTEM/" } /^SYSTEM\// {print "system/" $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config -C -D $(TARGET_OUT) -S $(SELINUX_FC) > $(zip_root)/META/filesystem_config.txt
@ -1995,13 +1996,10 @@ name := $(name)-img-$(FILE_NAME_TAG)
INTERNAL_UPDATE_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip INTERNAL_UPDATE_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
$(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) \ $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(ZIP2ZIP)
build/tools/releasetools/img_from_target_files
@echo "Package: $@" @echo "Package: $@"
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \ $(hide) $(ZIP2ZIP) -i $(BUILT_TARGET_FILES_PACKAGE) -o $@ \
./build/tools/releasetools/img_from_target_files -v \ OTA/android-info.txt:android-info.txt "IMAGES/*.img:."
-p $(HOST_OUT) \
$(BUILT_TARGET_FILES_PACKAGE) $@
.PHONY: updatepackage .PHONY: updatepackage
updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET) updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET)
@ -2025,11 +2023,13 @@ $(SYMBOLS_ZIP): $(INSTALLED_SYSTEMIMAGE) \
$(INSTALLED_VENDORIMAGE_TARGET) \ $(INSTALLED_VENDORIMAGE_TARGET) \
$(updater_dep) $(updater_dep)
endif endif
$(SYMBOLS_ZIP): $(SYMBOLS_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,symbols)/filelist
$(SYMBOLS_ZIP): $(SOONG_ZIP)
@echo "Package symbols: $@" @echo "Package symbols: $@"
$(hide) rm -rf $@ $(hide) rm -rf $@ $(PRIVATE_LIST_FILE)
$(hide) mkdir -p $(dir $@) $(TARGET_OUT_UNSTRIPPED) $(hide) mkdir -p $(dir $@) $(TARGET_OUT_UNSTRIPPED) $(dir $(PRIVATE_LIST_FILE))
$(hide) zip -qrX $@ $(TARGET_OUT_UNSTRIPPED) $(hide) find $(TARGET_OUT_UNSTRIPPED) | sort >$(PRIVATE_LIST_FILE)
$(hide) $(SOONG_ZIP) -d -o $@ -C $(TARGET_OUT_UNSTRIPPED) -l $(PRIVATE_LIST_FILE)
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# A zip of the Android Apps. Not keeping full path so that we don't # A zip of the Android Apps. Not keeping full path so that we don't

View File

@ -472,6 +472,9 @@ BCC_COMPAT := $(HOST_OUT_EXECUTABLES)/bcc_compat
DX := $(HOST_OUT_EXECUTABLES)/dx DX := $(HOST_OUT_EXECUTABLES)/dx
MAINDEXCLASSES := $(HOST_OUT_EXECUTABLES)/mainDexClasses MAINDEXCLASSES := $(HOST_OUT_EXECUTABLES)/mainDexClasses
SOONG_ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/soong_zip
ZIP2ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/zip2zip
# Always use prebuilts for ckati and makeparallel # Always use prebuilts for ckati and makeparallel
prebuilt_build_tools := prebuilts/build-tools prebuilt_build_tools := prebuilts/build-tools
prebuilt_build_tools_bin := $(prebuilt_build_tools)/$(HOST_PREBUILT_TAG)/bin prebuilt_build_tools_bin := $(prebuilt_build_tools)/$(HOST_PREBUILT_TAG)/bin