Use soong_zip instead of jar to generate .jar files in javac actions

This is to make the jar-output deterministic so that we can get
cache-hits for r8/d8 actions from RBE.

Change-Id: I911ee702fa5dabfe7122e82b21f78c811a0c960d
Test: m droid checkbuild
This commit is contained in:
Kousik Kumar 2020-04-16 12:43:40 -07:00
parent 1bc7f6436b
commit 7d61116cc1
4 changed files with 4 additions and 1 deletions

View file

@ -2093,7 +2093,7 @@ $(if $(PRIVATE_JAR_PACKAGES), \
$(if $(PRIVATE_JAR_EXCLUDE_PACKAGES), $(hide) rm -rf \ $(if $(PRIVATE_JAR_EXCLUDE_PACKAGES), $(hide) rm -rf \
$(foreach pkg, $(PRIVATE_JAR_EXCLUDE_PACKAGES), \ $(foreach pkg, $(PRIVATE_JAR_EXCLUDE_PACKAGES), \
$(PRIVATE_CLASS_INTERMEDIATES_DIR)/$(subst .,/,$(pkg)))) $(PRIVATE_CLASS_INTERMEDIATES_DIR)/$(subst .,/,$(pkg))))
$(hide) $(JAR) -cf $@ $(call jar-args-sorted-files-in-directory,$(PRIVATE_CLASS_INTERMEDIATES_DIR)) $(hide) $(SOONG_ZIP) -jar -o $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) -D $(PRIVATE_CLASS_INTERMEDIATES_DIR)
$(if $(PRIVATE_EXTRA_JAR_ARGS),$(call add-java-resources-to,$@)) $(if $(PRIVATE_EXTRA_JAR_ARGS),$(call add-java-resources-to,$@))
endef endef

View file

@ -99,6 +99,7 @@ $(full_classes_compiled_jar): \
$(NORMALIZE_PATH) \ $(NORMALIZE_PATH) \
$(JAR_ARGS) \ $(JAR_ARGS) \
$(ZIPSYNC) \ $(ZIPSYNC) \
$(SOONG_ZIP) \
| $(SOONG_JAVAC_WRAPPER) | $(SOONG_JAVAC_WRAPPER)
$(transform-host-java-to-dalvik-package) $(transform-host-java-to-dalvik-package)

View file

@ -90,6 +90,7 @@ $(full_classes_compiled_jar): \
$(ZIPTIME) \ $(ZIPTIME) \
$(JAR_ARGS) \ $(JAR_ARGS) \
$(ZIPSYNC) \ $(ZIPSYNC) \
$(SOONG_ZIP) \
| $(SOONG_JAVAC_WRAPPER) | $(SOONG_JAVAC_WRAPPER)
$(transform-host-java-to-package) $(transform-host-java-to-package)
$(remove-timestamps-from-package) $(remove-timestamps-from-package)

View file

@ -296,6 +296,7 @@ $(full_classes_compiled_jar): \
$(NORMALIZE_PATH) \ $(NORMALIZE_PATH) \
$(JAR_ARGS) \ $(JAR_ARGS) \
$(ZIPSYNC) \ $(ZIPSYNC) \
$(SOONG_ZIP) \
| $(SOONG_JAVAC_WRAPPER) | $(SOONG_JAVAC_WRAPPER)
@echo "Target Java: $@ @echo "Target Java: $@
$(call compile-java,$(TARGET_JAVAC),$(PRIVATE_ALL_JAVA_HEADER_LIBRARIES)) $(call compile-java,$(TARGET_JAVAC),$(PRIVATE_ALL_JAVA_HEADER_LIBRARIES))