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 <git-wear-master> branch locally, and then do:
m -j out/target/product/angelfish/package-stats.txt

Change-Id: I9a5d74caaf164b44676e456050b4f8a5b3bdded0
This commit is contained in:
Nan Zhang 2017-09-01 18:52:41 -07:00
parent 27bfc86d8b
commit d05e19df41
2 changed files with 10 additions and 5 deletions

View file

@ -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

View file

@ -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,$@)