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
diff --git a/core/definitions.mk b/core/definitions.mk
index 15752f9..ffeb663 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2656,12 +2656,17 @@
# 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