From d05e19df41cadcb8e789e00f05ee10a29467d175 Mon Sep 17 00:00:00 2001 From: Nan Zhang Date: Fri, 1 Sep 2017 18:52:41 -0700 Subject: [PATCH] Fix the build breakage on git-wear-master/mirror-aosp-master-with-vendor The problem is that when I added .KATI_RESTAT for javalib.jar, I didn't change the function: create-empty-package to generate javalib.jar.tmp. The problem causes the build breakage on MacOS/Jack. Bug: b/64308460 Test: download branch locally, and then do: m -j out/target/product/angelfish/package-stats.txt Change-Id: I9a5d74caaf164b44676e456050b4f8a5b3bdded0 --- core/definitions.mk | 11 ++++++++--- core/java_library.mk | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 15752f934c..ffeb66381a 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2656,12 +2656,17 @@ endef # Add resources carried by static Jack libraries. # define add-carried-jack-resources +$(call add-carried-jack-resources-to,$@) +endef + +# $(1) the target jar. +define add-carried-jack-resources-to $(hide) if [ -d $(PRIVATE_JACK_INTERMEDIATES_DIR) ] ; then \ find $(PRIVATE_JACK_INTERMEDIATES_DIR) -type f | sort \ | sed -e "s?^$(PRIVATE_JACK_INTERMEDIATES_DIR)/? -C \"$(PRIVATE_JACK_INTERMEDIATES_DIR)\" \"?" -e "s/$$/\"/" \ - > $(dir $@)jack_res_jar_flags; \ - if [ -s $(dir $@)jack_res_jar_flags ] ; then \ - $(JAR) uf $@ @$(dir $@)jack_res_jar_flags; \ + > $(dir $(1))jack_res_jar_flags; \ + if [ -s $(dir $(1))jack_res_jar_flags ] ; then \ + $(JAR) uf $(1) @$(dir $(1))jack_res_jar_flags; \ fi; \ fi endef diff --git a/core/java_library.mk b/core/java_library.mk index ea9874b53b..dace97490e 100644 --- a/core/java_library.mk +++ b/core/java_library.mk @@ -83,13 +83,13 @@ $(common_javalib.jar): PRIVATE_DONT_DELETE_JAR_DIRS := $(LOCAL_DONT_DELETE_JAR_D $(common_javalib.jar) : $(built_dex) $(java_resource_sources) | $(ZIPTIME) @echo "target Jar: $(PRIVATE_MODULE) ($@)" ifdef LOCAL_JACK_ENABLED - $(create-empty-package) + $(create-empty-package-at,$@.tmp) else $(call initialize-package-file,$(PRIVATE_SOURCE_ARCHIVE),$@.tmp) endif $(call add-dex-to-package-arg,$@.tmp) ifdef LOCAL_JACK_ENABLED - $(add-carried-jack-resources) + $(add-carried-jack-resources-to,$@.tmp) endif $(hide) $(ZIPTIME) $@.tmp $(call commit-change-for-toc,$@)