From dc4a6b8513c68cd9466cfc51c754306ca07188a3 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 3 Jan 2018 12:39:11 -0800 Subject: [PATCH 1/3] Use proguard.jacoco.flags for EMMA_INSTRUMENT_STATIC Add proguard.jacoco.flags whenever EMMA_INSTRUMENT_STATIC is set so that com.vladium.emma.rt.RT is not stripped. Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_STATIC=true Change-Id: Ie64a283d95e8bbf426cd39675d70a3a58768ebc7 --- core/java_library.mk | 2 ++ core/package_internal.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/java_library.mk b/core/java_library.mk index e4916b899..8cf007489 100644 --- a/core/java_library.mk +++ b/core/java_library.mk @@ -42,6 +42,8 @@ ifeq (true,$(EMMA_INSTRUMENT)) ifeq (true,$(LOCAL_EMMA_INSTRUMENT)) ifeq (true,$(EMMA_INSTRUMENT_STATIC)) LOCAL_STATIC_JAVA_LIBRARIES += jacocoagent +# Exclude jacoco classes from proguard +LOCAL_PROGUARD_FLAGS += -include $(BUILD_SYSTEM)/proguard.jacoco.flags endif # LOCAL_EMMA_INSTRUMENT endif # EMMA_INSTRUMENT_STATIC else diff --git a/core/package_internal.mk b/core/package_internal.mk index 2a6381745..6b5dca2f8 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -275,6 +275,8 @@ ifeq (true,$(EMMA_INSTRUMENT_STATIC)) ifneq ($(LOCAL_SRC_FILES)$(LOCAL_STATIC_JAVA_LIBRARIES)$(LOCAL_SOURCE_FILES_ALL_GENERATED),) # Only add jacocoagent if the package contains some java code LOCAL_STATIC_JAVA_LIBRARIES += jacocoagent +# Exclude jacoco classes from proguard +LOCAL_PROGUARD_FLAGS += -include $(BUILD_SYSTEM)/proguard.jacoco.flags endif # Contains java code else ifdef LOCAL_SDK_VERSION From d31ff8ff32c2a3a20c9a06b0829c4bcba55b85a2 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 3 Jan 2018 14:06:35 -0800 Subject: [PATCH 2/3] Fix adbs after move from build/tools to build/make/tools adbs broke when build/tools was moved to build/make/tools in aosp/286781. Bug: 15270043 Test: build/tools/adbs Change-Id: I0a34b2b446f996bcc53a7dde6381402f8eed9bd0 --- tools/adbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/adbs b/tools/adbs index a8f06c04e..8d73630da 100755 --- a/tools/adbs +++ b/tools/adbs @@ -20,7 +20,7 @@ import re import string import sys -sys.path.insert(0, os.path.dirname(__file__) + "/../../development/scripts") +sys.path.insert(0, os.path.dirname(__file__) + "/../../../development/scripts") import stack_core import symbol From ab61f213e05c298b6f76bfd1c07c496f264a035e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 4 Jan 2018 14:27:36 -0800 Subject: [PATCH 3/3] Clear resource_export_package outside conditionals $(resource_export_package) is used by package_internal.mk outside ifeq ($(need_compile_res),true), but only cleared inside the conditional. This causes unnecessary dependencies to be added to an old value of $(resource_export_package). In rare cases, the dependency can be on itself, causing a dependency loop. Bug: 71571462 Test: m checkbuild Change-Id: I9fda7fe3bf9d208ad4ba2f8cdb184034bf43f044 --- core/package_internal.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/package_internal.mk b/core/package_internal.mk index 6b5dca2f8..e153a8a11 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -363,6 +363,8 @@ $(foreach x,$(sharded_java_source_list_files),$(eval $(x): $(data_binding_stamp) $(full_classes_compiled_jar): $(data_binding_stamp) endif # LOCAL_DATA_BINDING +resource_export_package := + ifeq ($(need_compile_res),true) ############################### @@ -429,7 +431,6 @@ $(R_file_stamp): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_ $(proguard_options_file): $(R_file_stamp) -resource_export_package := ifdef LOCAL_EXPORT_PACKAGE_RESOURCES # Put this module's resources into a PRODUCT-agnositc package that # other packages can use to build their own PRODUCT-agnostic R.java (etc.)