From b518c3ec0bcd2d874be19fa4717262ad771fcc9c Mon Sep 17 00:00:00 2001 From: Yohann Roussel Date: Wed, 20 May 2015 17:52:15 +0200 Subject: [PATCH] [DO NOT MERGE] Add support for RMTYPEDEF with Jack Bug: 21099584 (cherry-picked from commit 5b2c6e26dbda66a2245f987db0428c2bf2eb7c95) Change-Id: I39aa1f24780c216e978ef743098ca7ac65b2962e --- core/definitions.mk | 3 ++- core/host_dalvik_java_library.mk | 2 +- core/host_java_library.mk | 3 ++- core/java.mk | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 87c94c0c54..db51f9497e 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1805,7 +1805,6 @@ endef # - below we write the list of java files to java-source-list to avoid argument # list length problems with Cygwin # - we filter out duplicate java file names because Jack doesn't like them. -# TODO (yroussel) PRIVATE_RMTYPEDEFS define jack-java-to-dex $(hide) rm -f $@ $(hide) rm -f $(PRIVATE_CLASSES_JACK) @@ -1840,6 +1839,8 @@ $(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \ $(if $(NO_OPTIMIZE_DX), \ -D jack.dex.optimize="false") \ + $(if $(PRIVATE_RMTYPEDEFS), \ + -D jack.android.remove-typedef="true") \ $(addprefix --classpath ,$(strip \ $(call normalize-path-list,$(PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES) $(PRIVATE_ALL_JACK_LIBRARIES)))) \ $(addprefix --import ,$(call reverse-list,$(PRIVATE_STATIC_JACK_LIBRARIES))) \ diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk index ff5ee1ef38..4814d70875 100644 --- a/core/host_dalvik_java_library.mk +++ b/core/host_dalvik_java_library.mk @@ -63,6 +63,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): \ PRIVATE_CLASS_INTERMEDIATES_DIR := $(intermediates.COMMON)/classes $(LOCAL_INTERMEDIATE_TARGETS): \ PRIVATE_SOURCE_INTERMEDIATES_DIR := $(LOCAL_INTERMEDIATE_SOURCE_DIR) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RMTYPEDEFS := $(cleantarget): PRIVATE_CLEAN_FILES += $(intermediates.COMMON) @@ -71,7 +72,6 @@ $(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := $(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := $(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := -$(full_classes_compiled_jar): PRIVATE_RMTYPEDEFS := $(full_classes_compiled_jar): \ $(java_sources) \ $(java_resource_sources) \ diff --git a/core/host_java_library.mk b/core/host_java_library.mk index 513d18506f..47189d7d05 100644 --- a/core/host_java_library.mk +++ b/core/host_java_library.mk @@ -43,6 +43,8 @@ LOCAL_INTERMEDIATE_TARGETS += \ include $(BUILD_SYSTEM)/base_rules.mk ####################################### +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RMTYPEDEFS := + ifeq (true,$(LOCAL_EMMA_INSTRUMENT)) $(full_classes_emma_jar): PRIVATE_EMMA_COVERAGE_FILE := $(intermediates.COMMON)/coverage.em $(full_classes_emma_jar): PRIVATE_EMMA_INTERMEDIATES_DIR := $(emma_intermediates_dir) @@ -78,7 +80,6 @@ $(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := $(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := $(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := -$(full_classes_compiled_jar): PRIVATE_RMTYPEDEFS := $(full_classes_compiled_jar): \ $(java_sources) \ $(java_resource_sources) \ diff --git a/core/java.mk b/core/java.mk index 944a685666..4885d74da6 100644 --- a/core/java.mk +++ b/core/java.mk @@ -328,6 +328,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): \ PRIVATE_CLASS_INTERMEDIATES_DIR := $(intermediates.COMMON)/classes $(LOCAL_INTERMEDIATE_TARGETS): \ PRIVATE_SOURCE_INTERMEDIATES_DIR := $(LOCAL_INTERMEDIATE_SOURCE_DIR) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RMTYPEDEFS := $(LOCAL_RMTYPEDEFS) # Since we're using intermediates.COMMON, make sure that it gets cleaned # properly. @@ -367,7 +368,6 @@ $(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := $(LOCAL_JAR_EXCLUDE_FILES) $(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := $(LOCAL_JAR_PACKAGES) $(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := $(LOCAL_JAR_EXCLUDE_PACKAGES) -$(full_classes_compiled_jar): PRIVATE_RMTYPEDEFS := $(LOCAL_RMTYPEDEFS) $(full_classes_compiled_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF) $(full_classes_compiled_jar): \ $(java_sources) \