Merge "Allows DX alternative Jar." am: 26d769ea3f am: 16168c016d

am: 5065fe2130

Change-Id: I6763da75914cd41c1bf3f78593c276c171401d0b
This commit is contained in:
Alan Leung 2017-05-16 22:05:53 +00:00 committed by android-build-merger
commit 1f5a362c97
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

@ -2554,14 +2554,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), \