From b3b6348921a1e96a5d6e0d4894842006a71c0963 Mon Sep 17 00:00:00 2001 From: Yohann Roussel Date: Tue, 21 Jul 2015 16:45:51 +0000 Subject: [PATCH] Revert "Clean call-jack and its callers" This reverts commit 4c1fc77c2e8453082601ed8209aaaf5e433bb2f4. Change-Id: I4f5e3ec1e6fea66f315a9411db17de257817dcc9 --- core/base_rules.mk | 1 + core/clear_vars.mk | 1 + core/config.mk | 21 +++++++++++++++++++-- core/definitions.mk | 8 ++++---- core/host_dalvik_java_library.mk | 2 +- core/host_dalvik_static_java_library.mk | 2 +- core/java.mk | 2 +- core/prebuilt_internal.mk | 2 +- 8 files changed, 29 insertions(+), 10 deletions(-) diff --git a/core/base_rules.mk b/core/base_rules.mk index c30eef0390..9c85e5b015 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -752,6 +752,7 @@ endif # LOCAL_SDK_VERSION endif # TARGET_ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JACK_LIBRARIES := $(full_static_jack_libs) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(LOCAL_JACK_VM_ARGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_EXTRA_ARGS := $(LOCAL_JACK_EXTRA_ARGS) ifdef LOCAL_IS_HOST_MODULE diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 0825a3b9f2..10be6d2bb9 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -109,6 +109,7 @@ LOCAL_ADDITIONAL_JAVA_DIR:= LOCAL_ALLOW_UNDEFINED_SYMBOLS:= LOCAL_DX_FLAGS:= LOCAL_JACK_ENABLED:=$(DEFAULT_JACK_ENABLED) # '' (ie disabled), disabled, full, incremental +LOCAL_JACK_VM_ARGS := $(DEFAULT_JACK_VM_ARGS) LOCAL_JACK_EXTRA_ARGS := $(DEFAULT_JACK_EXTRA_ARGS) LOCAL_JACK_FLAGS:= LOCAL_JILL_FLAGS:= diff --git a/core/config.mk b/core/config.mk index f398ada78e..54f1679f1c 100644 --- a/core/config.mk +++ b/core/config.mk @@ -388,7 +388,9 @@ endif # Generic tools. JACK := $(HOST_OUT_EXECUTABLES)/jack JACK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/jack.jar +JACK_LAUNCHER_JAR := $(HOST_OUT_JAVA_LIBRARIES)/jack-launcher.jar JILL_JAR := $(HOST_OUT_JAVA_LIBRARIES)/jill.jar +JACK_MULTIDEX_DEFAULT_PREPROCESSOR := frameworks/multidex/library/resources/JACK-INF/legacyMultidexInstallation.jpp LEX := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/flex/flex-2.5.39 # The default PKGDATADIR built in the prebuilt bison is a relative path @@ -440,12 +442,27 @@ DEFAULT_JACK_ENABLED:=full else DEFAULT_JACK_ENABLED:= endif +ifneq ($(strip $(ANDROID_JACK_VM)),) +JACK_VM := $(ANDROID_JACK_VM) +else +JACK_VM := java +endif # call jack # -# $(1): jack perf arguments +# $(1): vm arguments +# $(2): jack perf arguments +ifneq (,$(strip $(filter dist,$(MAKECMDGOALS)))) +JACK_SERVER_LOG_COMMAND := mkdir -p $(DIST_DIR)/logs/; SERVER_LOG=$(DIST_DIR)/logs/jack-server.log +endif define call-jack -$(JACK) $(1) +$(JACK_SERVER_LOG_COMMAND) JACK_VM_COMMAND="$(JACK_VM) $(1) $(JAVA_TMPDIR_ARG) -jar $(JACK_LAUNCHER_JAR) " JACK_JAR="$(JACK_JAR)" $(JACK) $(2) endef +$(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 -Xms2560m -XX:+TieredCompilation +endif ifneq ($(ANDROID_JACK_EXTRA_ARGS),) DEFAULT_JACK_EXTRA_ARGS := $(ANDROID_JACK_EXTRA_ARGS) else diff --git a/core/definitions.mk b/core/definitions.mk index 64e7aadc89..f0953cde5a 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1830,7 +1830,7 @@ $(hide) if [ -s $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then else \ export tmpEcjArg=""; \ fi; \ -$(call call-jack,$(PRIVATE_JACK_EXTRA_ARGS)) \ +$(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(strip $(PRIVATE_JACK_FLAGS)) \ $(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \ $(if $(NO_OPTIMIZE_DX), \ @@ -1850,7 +1850,7 @@ $(call call-jack,$(PRIVATE_JACK_EXTRA_ARGS)) \ $(addprefix --config-jarjar ,$(strip $(PRIVATE_JARJAR_RULES))) \ $(if $(PRIVATE_JACK_PROGUARD_FLAGS),--config-proguard $@.flags) \ $$tmpEcjArg \ - || ( rm -rf $(PRIVATE_CLASSES_JACK); exit 41 ) + || ( rm -rf $(PRIVATE_CLASSES_JACK); rm -rf $(PRIVATE_JACK_INTERMEDIATES_DIR); exit 41 ) $(hide) mv $(PRIVATE_JACK_INTERMEDIATES_DIR)/classes*.dex $(dir $@) $(hide) rm -f $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list $(if $(PRIVATE_EXTRA_JAR_ARGS),$(hide) rm -rf $@.res.tmp) @@ -1866,7 +1866,7 @@ define transform-jar-to-jack $(hide) mkdir -p $@.tmpjill.res $(hide) $(call unzip-jar-files,$<,$@.tmpjill.res) $(hide) find $@.tmpjill.res -iname "*.class" -delete - $(hide) $(call call-jack,$(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.type.policy=keep-first \ --import $@.tmpjill.jack \ @@ -1910,7 +1910,7 @@ $(hide) if [ -s $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then else \ export tmpEcjArg=""; \ fi; \ -$(call call-jack,$(PRIVATE_JACK_EXTRA_ARGS)) \ +$(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(strip $(PRIVATE_JACK_FLAGS)) \ $(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \ $(if $(NO_OPTIMIZE_DX), \ diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk index 5516e34dea..4814d70875 100644 --- a/core/host_dalvik_java_library.mk +++ b/core/host_dalvik_java_library.mk @@ -129,7 +129,7 @@ $(built_dex): PRIVATE_CLASSES_JACK := $(full_classes_jack) $(built_dex): PRIVATE_JACK_FLAGS := $(LOCAL_JACK_FLAGS) $(built_dex): $(java_sources) $(java_resource_sources) $(full_jack_lib_deps) \ $(jar_manifest_file) $(proto_java_sources_file_stamp) $(LOCAL_MODULE_MAKEFILE) \ - $(LOCAL_MODULE_MAKEFILE) $(LOCAL_ADDITIONAL_DEPENDENCIES) $(JACK) + $(LOCAL_MODULE_MAKEFILE) $(LOCAL_ADDITIONAL_DEPENDENCIES) $(JACK_JAR) $(JACK_LAUNCHER_JAR) @echo Building with Jack: $@ $(jack-java-to-dex) diff --git a/core/host_dalvik_static_java_library.mk b/core/host_dalvik_static_java_library.mk index 496e75dee0..90bcc12df0 100644 --- a/core/host_dalvik_static_java_library.mk +++ b/core/host_dalvik_static_java_library.mk @@ -48,7 +48,7 @@ endif $(full_classes_jack): $(java_sources) $(java_resource_sources) $(full_jack_lib_deps) \ $(jar_manifest_file) $(layers_file) $(LOCAL_MODULE_MAKEFILE) \ $(LOCAL_ADDITIONAL_DEPENDENCIES) $(LOCAL_JARJAR_RULES) \ - $(JACK) + $(JACK_JAR) $(JACK_LAUNCHER_JAR) @echo Building with Jack: $@ $(java-to-jack) diff --git a/core/java.mk b/core/java.mk index 83138aa3c3..b3712895d5 100644 --- a/core/java.mk +++ b/core/java.mk @@ -619,7 +619,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_FLAGS := $(LOCAL_JACK_FLAGS) jack_all_deps := $(java_sources) $(java_resource_sources) $(full_jack_lib_deps) \ $(jar_manifest_file) $(layers_file) $(RenderScript_file_stamp) $(proguard_flag_files) \ $(proto_java_sources_file_stamp) $(LOCAL_ADDITIONAL_DEPENDENCIES) $(LOCAL_JARJAR_RULES) \ - $(LOCAL_MODULE_MAKEFILE) $(JACK) + $(LOCAL_MODULE_MAKEFILE) $(JACK_JAR) $(JACK_LAUNCHER_JAR) ifeq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true) $(full_classes_jack): $(jack_all_deps) diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index aeca89ef67..04063537ff 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -313,7 +313,7 @@ endif # TARGET JAVA_LIBRARIES ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES) $(intermediates.COMMON)/classes.jack : PRIVATE_JILL_FLAGS:=$(LOCAL_JILL_FLAGS) $(intermediates.COMMON)/classes.jack : $(my_src_jar) $(LOCAL_MODULE_MAKEFILE) \ - $(LOCAL_ADDITIONAL_DEPENDENCIES) $(JILL_JAR) $(JACK) + $(LOCAL_ADDITIONAL_DEPENDENCIES) $(JILL_JAR) $(JACK_JAR) $(JACK_LAUNCHER_JAR) $(transform-jar-to-jack) endif # JAVA_LIBRARIES