Allows DX alternative Jar.

Test: m -j20 ANDROID_COMPILE_WITH_JACK=false DX_ALT_JAR=/mnt/m02/dx_alt.jar

Change-Id: I6163280101ff973bc8202a82d2fed42cf0ce6209
(cherry picked from commit b147846b67)
This commit is contained in:
Alan Leung 2017-05-11 17:44:59 -07:00 committed by Colin Cross
parent 1664b90d67
commit 83857b6cbd
2 changed files with 10 additions and 4 deletions

View file

@ -492,7 +492,16 @@ LLVM_RS_CC := $(HOST_OUT_EXECUTABLES)/llvm-rs-cc
BCC_COMPAT := $(HOST_OUT_EXECUTABLES)/bcc_compat
DEPMOD := $(HOST_OUT_EXECUTABLES)/depmod
#TODO: use a smaller -Xmx value for most libraries;
# only core.jar and framework.jar need a heap this big.
ifndef DX_ALT_JAR
DX := $(HOST_OUT_EXECUTABLES)/dx
DX_COMMAND := $(DX) -JXms16M -JXmx2048M
else
DX := $(DX_ALT_JAR)
DX_COMMAND := java -Xms16M -Xmx2048M -jar $(DX)
endif
MAINDEXCLASSES := $(HOST_OUT_EXECUTABLES)/mainDexClasses
SOONG_ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/soong_zip

View file

@ -2546,14 +2546,11 @@ $(hide) java -jar $(DESUGAR) \
endef
#TODO: use a smaller -Xmx value for most libraries;
# only core.jar and framework.jar need a heap this big.
define transform-classes.jar-to-dex
@echo "target Dex: $(PRIVATE_MODULE)"
@mkdir -p $(dir $@)
$(hide) rm -f $(dir $@)classes*.dex
$(hide) $(DX) \
-JXms16M -JXmx2048M \
$(hide) $(DX_COMMAND) \
--dex --output=$(dir $@) \
--min-sdk-version=$(call codename-or-sdk-to-sdk,$(PRIVATE_DEFAULT_APP_TARGET_SDK)) \
$(if $(NO_OPTIMIZE_DX), \