diff --git a/core/main.mk b/core/main.mk index e9b1bca4a..a13404a99 100644 --- a/core/main.mk +++ b/core/main.mk @@ -345,6 +345,15 @@ ifneq (,$(filter debug,$(tags_to_install))) endif endif +## java coverage ## +# Install additional tools on java coverage builds +ifeq (true,$(EMMA_INSTRUMENT)) +ifneq (,$(filter debug,$(tags_to_install))) + tags_to_install += java_coverage +endif +endif + + ## sdk ## ifdef is_sdk_build @@ -1139,6 +1148,7 @@ define product-installed-files $(if $(filter debug,$(tags_to_install)),$(PRODUCTS.$(_mk).PRODUCT_PACKAGES_DEBUG)) \ $(if $(filter tests,$(tags_to_install)),$(PRODUCTS.$(_mk).PRODUCT_PACKAGES_TESTS)) \ $(if $(filter asan,$(tags_to_install)),$(PRODUCTS.$(_mk).PRODUCT_PACKAGES_DEBUG_ASAN)) \ + $(if $(filter java_coverage,$(tags_to_install)),$(PRODUCTS.$(_mk).PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE)) \ $(call auto-included-modules) \ ) \ $(eval ### Filter out the overridden packages and executables before doing expansion) \ diff --git a/core/product.mk b/core/product.mk index 4b5c80574..40485638c 100644 --- a/core/product.mk +++ b/core/product.mk @@ -119,6 +119,8 @@ _product_var_list += PRODUCT_HOST_PACKAGES _product_var_list += PRODUCT_PACKAGES _product_var_list += PRODUCT_PACKAGES_DEBUG _product_var_list += PRODUCT_PACKAGES_DEBUG_ASAN +# Packages included only for eng/userdebug builds, when building with EMMA_INSTRUMENT=true +_product_var_list += PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE _product_var_list += PRODUCT_PACKAGES_ENG _product_var_list += PRODUCT_PACKAGES_TESTS diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 822d2ead8..ecc217dcd 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -382,6 +382,9 @@ PRODUCT_PACKAGES_DEBUG_ASAN := \ fuzz \ honggfuzz +PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE := \ + libdumpcoverage + PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\ frameworks/base/config/preloaded-classes:system/etc/preloaded-classes)