From c8ef37dfd88e39721c6f6666574ebb43613eff59 Mon Sep 17 00:00:00 2001 From: Alan Leung Date: Wed, 13 Dec 2017 00:11:40 -0800 Subject: [PATCH] Prep D8 default instead of CompatDX in build/core Also use zip2zip to extract classes into another jar to avoid hitting parameter limit in the shell invocations. Bug: 69329508 Test: m checkbuild tests Change-Id: Ic047aa699519b6b3fd100cb5395de945f96e4d0b --- core/definitions.mk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 405f7c604..5ad78fdc9 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2415,15 +2415,16 @@ endef define transform-classes-d8.jar-to-dex @echo "target Dex: $(PRIVATE_MODULE)" @mkdir -p $(dir $@) -$(hide) rm -rf $(dir $@)classes*.dex $(dir $@)*.class $(dir $@)d8_input -$(hide) unzip -qq -d $(dir $@)d8_input $< "*.class" +$(hide) rm -f $(dir $@)classes*.dex $(dir $@)d8_input.jar +$(hide) $(ZIP2ZIP) -j -i $< -o $(dir $@)d8_input.jar "**/*.class" $(hide) $(DX_COMMAND) \ --output $(dir $@) \ --min-api $(PRIVATE_MIN_SDK_VERSION) \ + $(subst --main-dex-list=, --main-dex-list , \ $(subst --no-locals, --release, \ - $(filter-out --core-library --multi-dex,$(PRIVATE_DX_FLAGS))) \ - $$(find $(dir $@)d8_input -name *.class | sort) -$(hide) rm -fr $(dir $@)d8_input + $(filter-out --core-library --multi-dex --minimal-main-dex,$(PRIVATE_DX_FLAGS)))) \ + $(dir $@)d8_input.jar +$(hide) rm -f $(dir $@)d8_input.jar endef # Create a mostly-empty .jar file that we'll add to later.