Merge "Simplify handling of ANDROID_JACK_* variables"

This commit is contained in:
Yohann Roussel 2015-02-05 08:37:40 +00:00 committed by Android (Google) Code Review
commit 4283c36732
4 changed files with 24 additions and 30 deletions

View File

@ -706,27 +706,8 @@ endif # LOCAL_SDK_VERSION
endif # TARGET_ endif # TARGET_
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JACK_LIBRARIES := $(full_static_jack_libs) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JACK_LIBRARIES := $(full_static_jack_libs)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(DEFAULT_JACK_VM_ARGS)
ifneq ($(ANDROID_JACK_VM_ARGS),)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(ANDROID_JACK_VM_ARGS)
endif
ifneq ($(LOCAL_JACK_VM_ARGS),)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(LOCAL_JACK_VM_ARGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(LOCAL_JACK_VM_ARGS)
endif
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_EXTRA_ARGS := $(DEFAULT_JACK_EXTRA_ARGS)
ifneq ($(ANDROID_JACK_EXTRA_ARGS),)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_EXTRA_ARGS := $(ANDROID_JACK_EXTRA_ARGS)
endif
ifneq ($(LOCAL_JACK_EXTRA_ARGS),)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_EXTRA_ARGS := $(LOCAL_JACK_EXTRA_ARGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_EXTRA_ARGS := $(LOCAL_JACK_EXTRA_ARGS)
endif
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM := $(DEFAULT_JACK_VM)
ifneq ($(strip $(ANDROID_JACK_VM)),)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM := $(ANDROID_JACK_VM)
endif
ifdef LOCAL_IS_HOST_MODULE ifdef LOCAL_IS_HOST_MODULE
ifeq ($(USE_CORE_LIB_BOOTCLASSPATH),true) ifeq ($(USE_CORE_LIB_BOOTCLASSPATH),true)

View File

@ -107,9 +107,9 @@ LOCAL_JARJAR_RULES:=
LOCAL_ADDITIONAL_JAVA_DIR:= LOCAL_ADDITIONAL_JAVA_DIR:=
LOCAL_ALLOW_UNDEFINED_SYMBOLS:= LOCAL_ALLOW_UNDEFINED_SYMBOLS:=
LOCAL_DX_FLAGS:= LOCAL_DX_FLAGS:=
LOCAL_USE_JACK:=$(ANDROID_COMPILE_WITH_JACK) LOCAL_USE_JACK:= $(ANDROID_COMPILE_WITH_JACK)
LOCAL_JACK_VM_ARGS := LOCAL_JACK_VM_ARGS := $(DEFAULT_JACK_VM_ARGS)
LOCAL_JACK_EXTRA_ARGS := LOCAL_JACK_EXTRA_ARGS := $(DEFAULT_JACK_EXTRA_ARGS)
LOCAL_JACK_FLAGS:= LOCAL_JACK_FLAGS:=
LOCAL_CERTIFICATE:= LOCAL_CERTIFICATE:=
LOCAL_SDK_VERSION:= LOCAL_SDK_VERSION:=

View File

@ -405,17 +405,30 @@ MKTARBALL := build/tools/mktarball.sh
TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX) TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX)
E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX) E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX)
JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar
ifneq ($(strip $(ANDROID_JACK_VM)),)
JACK_VM := $(ANDROID_JACK_VM)
else
JACK_VM := java
endif
# call jack # call jack
# #
# $(1): vm # $(1): vm arguments
# $(2): vm arguments # $(2): jack perf arguments
# $(3): jack perf arguments
define call-jack define call-jack
$(1) $(2) -cp $(JACK_JAR) com.android.jack.Main $(3) $(JACK_VM) $(1) -cp $(JACK_JAR) com.android.jack.Main $(2)
endef endef
DEFAULT_JACK_VM := java $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(DEFAULT_JACK_VM_ARGS)
ifneq ($(ANDROID_JACK_VM_ARGS),)
DEFAULT_JACK_VM_ARGS := $(ANDROID_JACK_VM_ARGS)
else
DEFAULT_JACK_VM_ARGS := -Dfile.encoding=UTF-8 -Xmx3584m -Xms2560m -XX:+TieredCompilation DEFAULT_JACK_VM_ARGS := -Dfile.encoding=UTF-8 -Xmx3584m -Xms2560m -XX:+TieredCompilation
endif
ifneq ($(ANDROID_JACK_EXTRA_ARGS),)
DEFAULT_JACK_EXTRA_ARGS := $(ANDROID_JACK_EXTRA_ARGS)
else
DEFAULT_JACK_EXTRA_ARGS := -D sched.runner=single-threaded --sanity-checks off DEFAULT_JACK_EXTRA_ARGS := -D sched.runner=single-threaded --sanity-checks off
endif
JILL := java -Xmx3500m -cp $(JILL_JAR) com.android.jill.Main JILL := java -Xmx3500m -cp $(JILL_JAR) com.android.jill.Main
PROGUARD := external/proguard/bin/proguard.sh PROGUARD := external/proguard/bin/proguard.sh
JAVATAGS := build/tools/java-event-log-tags.py JAVATAGS := build/tools/java-event-log-tags.py

View File

@ -1752,7 +1752,7 @@ $(hide) if [ -s $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then
else \ else \
export tmpEcjArg=""; \ export tmpEcjArg=""; \
fi; \ fi; \
$(call call-jack,$(PRIVATE_JACK_VM),$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \
$(strip $(PRIVATE_JACK_FLAGS)) \ $(strip $(PRIVATE_JACK_FLAGS)) \
$(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \ $(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \
$(if $(NO_OPTIMIZE_DX), \ $(if $(NO_OPTIMIZE_DX), \
@ -1785,7 +1785,7 @@ define transform-jar-to-jack
$(hide) mkdir -p $@.tmpjill.res $(hide) mkdir -p $@.tmpjill.res
$(hide) $(call unzip-jar-files,$<,$@.tmpjill.res) $(hide) $(call unzip-jar-files,$<,$@.tmpjill.res)
$(hide) find $@.tmpjill.res -iname "*.class" -delete $(hide) find $@.tmpjill.res -iname "*.class" -delete
$(hide) $(call call-jack,$(PRIVATE_JACK_VM),$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(hide) $(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \
-D jack.import.resource.policy=keep-first \ -D jack.import.resource.policy=keep-first \
-D jack.import.type.policy=keep-first \ -D jack.import.type.policy=keep-first \
--import $@.tmpjill.jack \ --import $@.tmpjill.jack \
@ -1828,7 +1828,7 @@ $(hide) if [ -s $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then
else \ else \
export tmpEcjArg=""; \ export tmpEcjArg=""; \
fi; \ fi; \
$(call call-jack,$(PRIVATE_JACK_VM),$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \
$(strip $(PRIVATE_JACK_FLAGS)) \ $(strip $(PRIVATE_JACK_FLAGS)) \
$(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \ $(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \
$(if $(NO_OPTIMIZE_DX), \ $(if $(NO_OPTIMIZE_DX), \