From ff812829b6f23d3eefbe6d9c131a6479737171ec Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 20 Dec 2017 17:03:52 -0800 Subject: [PATCH 1/2] Remove obsolete dx --no-locals when coverage is enabled We use jacoco for coverage now instead of emma, so the workaround is no longer necessary. Bug: 70886092 Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false Change-Id: I103cbe58590689640a0b1520d22b3d3b7cd2208d --- core/java.mk | 9 --------- 1 file changed, 9 deletions(-) diff --git a/core/java.mk b/core/java.mk index 08e403510..3bde949a9 100644 --- a/core/java.mk +++ b/core/java.mk @@ -751,15 +751,6 @@ endif # LOCAL_PROGUARD_ENABLED defined ifneq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true) $(built_dex_intermediate): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS) -# If you instrument class files that have local variable debug information in -# them emma does not correctly maintain the local variable table. -# This will cause an error when you try to convert the class files for Android. -# The workaround here is to build different dex file here based on emma switch -# then later copy into classes.dex. When emma is on, dx is run with --no-locals -# option to remove local variable information -ifeq ($(LOCAL_EMMA_INSTRUMENT),true) -$(built_dex_intermediate): PRIVATE_DX_FLAGS += --no-locals -endif my_r8 := ifdef LOCAL_PROGUARD_ENABLED From a6e878219c8ae1853f3ae1e5e0740f230a68b7ec Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 20 Dec 2017 17:33:01 -0800 Subject: [PATCH 2/2] Remove obsolete leaf names classes-no-debug-var.jar is incorrect, jars in coverage builds do have debug information. Remove full_classes_compiled_jar_leaf and hardcode classes-full-debug.jar. After the previous patch, all dex files have debug information, so remove the no-local and with-local directories and replace them with dex/. Remove the unnecessary jarjar_leaf. Bug: 70886092 Test: m checkbuild Change-Id: I63eace8f8cda5ad8bc0cbd11eefda73dd063ed76 --- CleanSpec.mk | 6 ++++++ core/java.mk | 16 +++------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/CleanSpec.mk b/CleanSpec.mk index 1a84e8faf..7e23ee084 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -450,6 +450,12 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/vndk-sp) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/vndk) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/vndk-sp) +# Remove old dex output directories +$(call add-clean-step, rm -rf $(TARGET_OUT_COMMON_INTERMEDIATES)/*/*_intermediates/with-local/) +$(call add-clean-step, rm -rf $(TARGET_OUT_COMMON_INTERMEDIATES)/*/*_intermediates/no-local/) +$(call add-clean-step, rm -rf $(HOST_OUT_COMMON_INTERMEDIATES)/*/*_intermediates/with-local/) +$(call add-clean-step, rm -rf $(HOST_OUT_COMMON_INTERMEDIATES)/*/*_intermediates/no-local/) + # ************************************************ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ diff --git a/core/java.mk b/core/java.mk index 3bde949a9..23cfeb87b 100644 --- a/core/java.mk +++ b/core/java.mk @@ -59,15 +59,6 @@ endif intermediates := $(call local-intermediates-dir) intermediates.COMMON := $(call local-intermediates-dir,COMMON) -# Choose leaf name for the compiled jar file. -ifeq ($(LOCAL_EMMA_INSTRUMENT),true) -full_classes_compiled_jar_leaf := classes-no-debug-var.jar -built_dex_intermediate_leaf := no-local -else -full_classes_compiled_jar_leaf := classes-full-debug.jar -built_dex_intermediate_leaf := with-local -endif - ifeq ($(LOCAL_PROGUARD_ENABLED),disabled) LOCAL_PROGUARD_ENABLED := endif @@ -75,14 +66,13 @@ endif full_classes_turbine_jar := $(intermediates.COMMON)/classes-turbine.jar full_classes_header_jarjar := $(intermediates.COMMON)/classes-header-jarjar.jar full_classes_header_jar := $(intermediates.COMMON)/classes-header.jar -full_classes_compiled_jar := $(intermediates.COMMON)/$(full_classes_compiled_jar_leaf) +full_classes_compiled_jar := $(intermediates.COMMON)/classes-full-debug.jar full_classes_processed_jar := $(intermediates.COMMON)/classes-processed.jar full_classes_desugar_jar := $(intermediates.COMMON)/classes-desugar.jar -jarjar_leaf := classes-jarjar.jar -full_classes_jarjar_jar := $(intermediates.COMMON)/$(jarjar_leaf) +full_classes_jarjar_jar := $(intermediates.COMMON)/classes-jarjar.jar full_classes_proguard_jar := $(intermediates.COMMON)/classes-proguard.jar full_classes_combined_jar := $(intermediates.COMMON)/classes-combined.jar -built_dex_intermediate := $(intermediates.COMMON)/$(built_dex_intermediate_leaf)/classes.dex +built_dex_intermediate := $(intermediates.COMMON)/dex/classes.dex full_classes_stubs_jar := $(intermediates.COMMON)/stubs.jar java_source_list_file := $(intermediates.COMMON)/java-source-list