From 91f53fddc7bb340a3d0c826677cf0767a8cfba1f Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 29 Apr 2019 10:25:20 -0700 Subject: Remove reverse-list from java static libraries. Make was reversing the list of static library dependencies when passing it to merge_zips. This was originally done to match the behavior of unzipping each static library in order into the same directory, overwriting duplicates each time. This order is counter-intuitive, and Soong does it the sensible way (first one takes priority, the same as the compile classpath). Fix Make to match Soong. Bug: 131603999 Test: m checkbuild Test: compare target_files.zip Change-Id: Idad125068ed2f750dc2dd95ab82bacb6e074489d --- core/definitions.mk | 4 ++-- core/host_dalvik_java_library.mk | 2 +- core/host_java_library.mk | 2 +- core/java.mk | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index aa2a2a95a4..af6248d4e6 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2094,9 +2094,9 @@ $(hide) if [ -s $(PRIVATE_JAVA_SOURCE_LIST) -o -n "$(PRIVATE_SRCJARS)" ] ; then $(addprefix --bootclasspath ,$(strip $(PRIVATE_BOOTCLASSPATH))) \ $(addprefix --classpath ,$(strip $(PRIVATE_ALL_JAVA_HEADER_LIBRARIES))) \ || ( rm -rf $(dir $@)/classes-turbine ; exit 41 ) && \ - $(MERGE_ZIPS) -j --ignore-duplicates -stripDir META-INF $@.tmp $@.premerged $(call reverse-list,$(PRIVATE_STATIC_JAVA_HEADER_LIBRARIES)) ; \ + $(MERGE_ZIPS) -j --ignore-duplicates -stripDir META-INF $@.tmp $@.premerged $(PRIVATE_STATIC_JAVA_HEADER_LIBRARIES) ; \ else \ - $(MERGE_ZIPS) -j --ignore-duplicates -stripDir META-INF $@.tmp $(call reverse-list,$(PRIVATE_STATIC_JAVA_HEADER_LIBRARIES)) ; \ + $(MERGE_ZIPS) -j --ignore-duplicates -stripDir META-INF $@.tmp $(PRIVATE_STATIC_JAVA_HEADER_LIBRARIES) ; \ fi $(hide) $(ZIPTIME) $@.tmp $(hide) $(call commit-change-for-toc,$@) diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk index 1545f63ccb..423575cb10 100644 --- a/core/host_dalvik_java_library.mk +++ b/core/host_dalvik_java_library.mk @@ -141,7 +141,7 @@ $(full_classes_combined_jar): $(full_classes_compiled_jar) \ $(PRIVATE_JAR_MANIFEST) > $(dir $@)/manifest.mf) $(MERGE_ZIPS) -j --ignore-duplicates $(if $(PRIVATE_JAR_MANIFEST),-m $(dir $@)/manifest.mf) \ $(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,-stripDir META-INF -zipToNotStrip $<) \ - $@ $< $(call reverse-list,$(PRIVATE_STATIC_JAVA_LIBRARIES)) + $@ $< $(PRIVATE_STATIC_JAVA_LIBRARIES) # Run jarjar if necessary, otherwise just copy the file. ifneq ($(strip $(LOCAL_JARJAR_RULES)),) diff --git a/core/host_java_library.mk b/core/host_java_library.mk index f7bf337c6c..1225fa996b 100644 --- a/core/host_java_library.mk +++ b/core/host_java_library.mk @@ -103,7 +103,7 @@ $(full_classes_combined_jar): $(full_classes_compiled_jar) \ $(PRIVATE_JAR_MANIFEST) > $(dir $@)/manifest.mf) $(MERGE_ZIPS) -j --ignore-duplicates $(if $(PRIVATE_JAR_MANIFEST),-m $(dir $@)/manifest.mf) \ $(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,-stripDir META-INF -zipToNotStrip $<) \ - $@ $< $(call reverse-list,$(PRIVATE_STATIC_JAVA_LIBRARIES)) + $@ $< $(PRIVATE_STATIC_JAVA_LIBRARIES) # Run jarjar if necessary, otherwise just copy the file. ifneq ($(strip $(LOCAL_JARJAR_RULES)),) diff --git a/core/java.mk b/core/java.mk index afc77d6fcd..b951f14f53 100644 --- a/core/java.mk +++ b/core/java.mk @@ -309,7 +309,7 @@ $(full_classes_combined_jar): $(full_classes_compiled_jar) \ $(PRIVATE_JAR_MANIFEST) > $(dir $@)/manifest.mf) $(MERGE_ZIPS) -j --ignore-duplicates $(if $(PRIVATE_JAR_MANIFEST),-m $(dir $@)/manifest.mf) \ $(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,-stripDir META-INF -zipToNotStrip $<) \ - $@ $< $(call reverse-list,$(PRIVATE_STATIC_JAVA_LIBRARIES)) + $@ $< $(PRIVATE_STATIC_JAVA_LIBRARIES) ifdef LOCAL_JAR_PROCESSOR # LOCAL_JAR_PROCESSOR_ARGS must be evaluated here to set up the rule-local -- cgit v1.2.3-59-g8ed1b