Clean up LOCAL_DONT_DELETE_JAR_META_INF

Allow setting it for host modules, it is necessary for
RoboLectric.

Remove some unused PRIVATE_DONT_DELETE_JAR_META_INF variables.

Remove unzip-jar-files, it is obsolete since merge_zips was
introduced.

Test: m checkbuild
Change-Id: I3f2fc466321904eace31525cbac99ad524f39188
This commit is contained in:
Colin Cross 2019-04-22 22:18:09 -07:00
parent 91871f3692
commit aebe1e9fe9
4 changed files with 3 additions and 24 deletions

View File

@ -1997,26 +1997,6 @@ define dump-words-to-file
@$(call emit-line,$(wordlist 13001,13500,$(1)),$(2))
@$(if $(wordlist 13501,13502,$(1)),$(error Too many words ($(words $(1)))))
endef
# For a list of jar files, unzip them to a specified directory,
# but make sure that no META-INF files come along for the ride,
# unless PRIVATE_DONT_DELETE_JAR_META_INF is set.
#
# $(1): files to unzip
# $(2): destination directory
define unzip-jar-files
$(hide) for f in $(1); \
do \
if [ ! -f $$f ]; then \
echo Missing file $$f; \
exit 1; \
fi; \
unzip -qo $$f -d $(2); \
rm -f $(2)/module-info.class; \
done
$(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,$(hide) rm -rf $(2)/META-INF)
endef
# Return jar arguments to compress files in a given directory
# $(1): directory
#

View File

@ -104,7 +104,6 @@ $(full_classes_compiled_jar): \
ifneq ($(TURBINE_ENABLED),false)
$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_turbine_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_turbine_jar): PRIVATE_SRCJARS := $(LOCAL_SRCJARS)
$(full_classes_turbine_jar): \
$(java_source_list_file) \

View File

@ -95,13 +95,15 @@ javac-check : $(full_classes_compiled_jar)
javac-check-$(LOCAL_MODULE) : $(full_classes_compiled_jar)
.PHONY: javac-check-$(LOCAL_MODULE)
$(full_classes_combined_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_combined_jar): $(full_classes_compiled_jar) \
$(jar_manifest_file) \
$(full_static_java_libs) | $(MERGE_ZIPS)
$(if $(PRIVATE_JAR_MANIFEST), $(hide) sed -e "s/%BUILD_NUMBER%/$(BUILD_NUMBER_FROM_FILE)/" \
$(PRIVATE_JAR_MANIFEST) > $(dir $@)/manifest.mf)
$(MERGE_ZIPS) -j --ignore-duplicates $(if $(PRIVATE_JAR_MANIFEST),-m $(dir $@)/manifest.mf) \
-stripDir META-INF -zipToNotStrip $< $@ $< $(call reverse-list,$(PRIVATE_STATIC_JAVA_LIBRARIES))
$(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,-stripDir META-INF -zipToNotStrip $<) \
$@ $< $(call reverse-list,$(PRIVATE_STATIC_JAVA_LIBRARIES))
# Run jarjar if necessary, otherwise just copy the file.
ifneq ($(strip $(LOCAL_JARJAR_RULES)),)

View File

@ -244,7 +244,6 @@ ifneq ($(TURBINE_ENABLED),false)
$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_turbine_jar): PRIVATE_SRCJARS := $(LOCAL_SRCJARS)
$(full_classes_turbine_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_turbine_jar): \
$(java_source_list_file) \
$(java_sources_deps) \
@ -278,7 +277,6 @@ $(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annota
$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := $(LOCAL_JAR_EXCLUDE_FILES)
$(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := $(LOCAL_JAR_PACKAGES)
$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := $(LOCAL_JAR_EXCLUDE_PACKAGES)
$(full_classes_compiled_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_compiled_jar): PRIVATE_JAVA_SOURCE_LIST := $(java_source_list_file)
$(full_classes_compiled_jar): PRIVATE_ALL_JAVA_HEADER_LIBRARIES := $(full_java_header_libs)
$(full_classes_compiled_jar): PRIVATE_SRCJARS := $(LOCAL_SRCJARS)