From 2e046e6c610f95a9e3ab464421da3ca541c66b89 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Wed, 14 Apr 2021 17:50:48 +0100 Subject: [PATCH] Avoid adding jacocoagent to bootclasspath twice Previously: * If EMMA_INSTRUMENT_FRAMEWORK=true then jacocoagent was added to the ART_APEX_JARS which itself is added to PRODUCT_BOOT_JARS. * If EMMA_INSTRUMENT=true then it was added directly to the PRODUCT_BOOT_JARS. * If both were true then it was added in both places ending up on the bootclasspath twice. Bug: 185369704 Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true droid m droid Change-Id: Id1d4d1c98455cb2859ed5e4071a0cf14fb40eec4 --- target/product/base_system.mk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 8562d4f184..21beda9ebf 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -291,10 +291,16 @@ endif ifeq ($(EMMA_INSTRUMENT),true) ifneq ($(EMMA_INSTRUMENT_STATIC),true) # For instrumented build, if Jacoco is not being included statically - # in instrumented packages then include Jacoco classes into the - # bootclasspath. + # in instrumented packages then include Jacoco classes in the product + # packages. PRODUCT_PACKAGES += jacocoagent - PRODUCT_BOOT_JARS += jacocoagent + ifneq ($(EMMA_INSTRUMENT_FRAMEWORK),true) + # For instrumented build, if Jacoco is not being included statically + # in instrumented packages and has not already been included in the + # bootclasspath via ART_APEX_JARS then include Jacoco classes into the + # bootclasspath. + PRODUCT_BOOT_JARS += jacocoagent + endif # EMMA_INSTRUMENT_FRAMEWORK endif # EMMA_INSTRUMENT_STATIC endif # EMMA_INSTRUMENT