diff --git a/core/base_rules.mk b/core/base_rules.mk index e4a662631..e252b9538 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -279,8 +279,6 @@ my_checked_module := # checked modules, use LOCAL_BUILT_MODULE. ifdef LOCAL_CHECKED_MODULE my_checked_module := $(LOCAL_CHECKED_MODULE) -else ifdef java_alternative_checked_module - my_checked_module := $(java_alternative_checked_module) else my_checked_module := $(LOCAL_BUILT_MODULE) endif diff --git a/core/combo/javac.mk b/core/combo/javac.mk index e3838a6db..d00f541c1 100644 --- a/core/combo/javac.mk +++ b/core/combo/javac.mk @@ -35,6 +35,8 @@ ifeq ($(CUSTOM_JAVA_COMPILER), eclipse) $(info CUSTOM_JAVA_COMPILER=eclipse) endif +GLOBAL_JAVAC_DEBUG_FLAGS := -g + HOST_JAVAC ?= $(COMMON_JAVAC) TARGET_JAVAC ?= $(COMMON_JAVAC) diff --git a/core/definitions.mk b/core/definitions.mk index 5e18242e7..8480512e5 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1734,7 +1734,6 @@ $(hide) tr ' ' '\n' < $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list \ | sort -u > $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq $(hide) if [ -s $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then \ $(1) -encoding UTF-8 \ - $(strip $(PRIVATE_JAVAC_DEBUG_FLAGS)) \ $(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \ $(2) \ $(addprefix -classpath ,$(strip \ @@ -1813,7 +1812,6 @@ else \ fi; \ $(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(strip $(PRIVATE_JACK_FLAGS)) \ - $(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \ $(if $(NO_OPTIMIZE_DX), \ -D jack.dex.optimize="false") \ $(if $(PRIVATE_RMTYPEDEFS), \ @@ -1893,7 +1891,6 @@ else \ fi; \ $(call call-jack,$(PRIVATE_JACK_VM_ARGS),$(PRIVATE_JACK_EXTRA_ARGS)) \ $(strip $(PRIVATE_JACK_FLAGS)) \ - $(strip $(PRIVATE_JACK_DEBUG_FLAGS)) \ $(if $(NO_OPTIMIZE_DX), \ -D jack.dex.optimize="false") \ $(addprefix --classpath ,$(strip \ diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk index 7f5927286..aa700e189 100644 --- a/core/host_dalvik_java_library.mk +++ b/core/host_dalvik_java_library.mk @@ -45,7 +45,9 @@ LOCAL_INTERMEDIATE_TARGETS += \ $(built_dex) # See comment in java.mk -java_alternative_checked_module := $(full_classes_compiled_jar) +ifndef LOCAL_CHECKED_MODULE +LOCAL_CHECKED_MODULE := $(full_classes_compiled_jar) +endif ####################################### include $(BUILD_SYSTEM)/base_rules.mk @@ -56,10 +58,6 @@ all_java_sources := $(java_sources) include $(BUILD_SYSTEM)/java_common.mk -$(full_classes_compiled_jar): PRIVATE_JAVAC_DEBUG_FLAGS := -g - -java_alternative_checked_module := - # The layers file allows you to enforce a layering between java packages. # Run build/tools/java-layers.py for more details. layers_file := $(addprefix $(LOCAL_PATH)/, $(LOCAL_JAVA_LAYERS_FILE)) @@ -67,7 +65,7 @@ layers_file := $(addprefix $(LOCAL_PATH)/, $(LOCAL_JAVA_LAYERS_FILE)) $(cleantarget): PRIVATE_CLEAN_FILES += $(intermediates.COMMON) $(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file) -$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) +$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(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 := @@ -122,10 +120,9 @@ else $(LOCAL_INTERMEDIATE_TARGETS): \ PRIVATE_JACK_INCREMENTAL_DIR := endif -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_DEBUG_FLAGS := -g $(built_dex): PRIVATE_CLASSES_JACK := $(full_classes_jack) -$(built_dex): PRIVATE_JACK_FLAGS := $(LOCAL_JACK_FLAGS) +$(built_dex): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_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_JAR) $(JACK_LAUNCHER_JAR) diff --git a/core/host_dalvik_static_java_library.mk b/core/host_dalvik_static_java_library.mk index 90bcc12df..c6ba915a8 100644 --- a/core/host_dalvik_static_java_library.mk +++ b/core/host_dalvik_static_java_library.mk @@ -34,7 +34,7 @@ LOCAL_INTERMEDIATE_TARGETS += \ include $(BUILD_SYSTEM)/host_java_library.mk # proguard is not supported # *.proto files are not supported -$(full_classes_jack): PRIVATE_JACK_FLAGS := $(LOCAL_JACK_FLAGS) +$(full_classes_jack): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS) $(full_classes_jack): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES) $(full_classes_jack): \ PRIVATE_JACK_INTERMEDIATES_DIR := $(intermediates.COMMON)/jack-rsc diff --git a/core/host_java_library.mk b/core/host_java_library.mk index 8ae2e47d9..0a1119ff6 100644 --- a/core/host_java_library.mk +++ b/core/host_java_library.mk @@ -73,14 +73,12 @@ else # LOCAL_EMMA_INSTRUMENT full_classes_compiled_jar := $(built_javalib_jar) endif # LOCAL_EMMA_INSTRUMENT -$(full_classes_compiled_jar): PRIVATE_JAVAC_DEBUG_FLAGS := -g - # The layers file allows you to enforce a layering between java packages. # Run build/tools/java-layers.py for more details. layers_file := $(addprefix $(LOCAL_PATH)/, $(LOCAL_JAVA_LAYERS_FILE)) $(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file) -$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) +$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(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 := diff --git a/core/java.mk b/core/java.mk index 2b48c0c18..8972bdcea 100644 --- a/core/java.mk +++ b/core/java.mk @@ -328,19 +328,16 @@ endif # to fail except for bugs in their respective tools. If you would # like to run these rules, add the "all" modifier goal to the make # command line. +ifndef LOCAL_CHECKED_MODULE ifdef full_classes_jar -java_alternative_checked_module := $(full_classes_compiled_jar) -else -java_alternative_checked_module := +LOCAL_CHECKED_MODULE := $(full_classes_compiled_jar) +endif endif ####################################### include $(BUILD_SYSTEM)/base_rules.mk ####################################### -java_alternative_checked_module := - - ########################################## java_sources := $(addprefix $(LOCAL_PATH)/, $(filter %.java,$(LOCAL_SRC_FILES))) $(aidl_java_sources) $(logtags_java_sources) \ $(filter %.java,$(LOCAL_GENERATED_SOURCES)) @@ -416,7 +413,7 @@ endif # This intentionally depends on java_sources, not all_java_sources. # Deps for generated source files must be handled separately, # via deps on the target that generates the sources. -$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) +$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(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) @@ -433,8 +430,6 @@ $(full_classes_compiled_jar): \ $(LOCAL_ADDITIONAL_DEPENDENCIES) $(transform-java-to-classes.jar) -$(full_classes_compiled_jar): PRIVATE_JAVAC_DEBUG_FLAGS := -g - # Run jarjar if necessary, otherwise just copy the file. ifneq ($(strip $(LOCAL_JARJAR_RULES)),) $(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES) @@ -626,8 +621,6 @@ $(LOCAL_INTERMEDIATE_TARGETS): \ endif ifdef full_classes_jar -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_DEBUG_FLAGS := -g - ifdef LOCAL_PROGUARD_ENABLED ifndef LOCAL_JACK_PROGUARD_FLAGS @@ -643,7 +636,7 @@ else # LOCAL_PROGUARD_ENABLED not defined $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_PROGUARD_FLAGS := endif # LOCAL_PROGUARD_ENABLED defined -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_FLAGS := $(LOCAL_JACK_FLAGS) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_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) \