Add new build flag LOCAL_DONT_DELETE_JAR_DIRS.
Normally the build function initialize-package-file will delete all
class files and all directory entries from JAR files, but sometimes
external projects (eg. ICU4J) depend on having directory entries in
their JAR files.
This change adds the flag LOCAL_DONT_DELETE_JAR_DIRS (analogous to the
flag LOCAL_DONT_DELETE_JAR_META_INF) which when set will skip deletion
of directory entries in initialize-package-file.
Change-Id: I4464b947b7528fca23925affa95e4071915f04d4
diff --git a/core/definitions.mk b/core/definitions.mk
index e276887..37f7d9d 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1785,7 +1785,9 @@
define initialize-package-file
@mkdir -p $(dir $(2))
$(hide) cp -f $(1) $(2)
-$(hide) zip -qd $(2) "*.class" "*/" || true # Ignore the error when nothing to delete.
+$(hide) zip -qd $(2) "*.class" \
+ $(if $(strip $(PRIVATE_DONT_DELETE_JAR_DIRS)),,"*/") \
+ || true # Ignore the error when nothing to delete.
endef
#TODO: we kinda want to build different asset packages for