From 6fdbdc86f667a33a23470c2d18fac1f983a95991 Mon Sep 17 00:00:00 2001 From: Jeff Gaston Date: Wed, 25 Oct 2017 15:55:16 -0700 Subject: [PATCH] Skip instrumenting non-class files Jacoco normally recurses into .jar files, but we don't want it to. Some .jar files may be intentionally corrupt test files. Test: m -j showcommands dist EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false cts google-tradefed-all general-tests tests Bug: 68056327 Change-Id: I1550e3acafd7cd9a65164742370e051d3eb3bf69 --- core/jacoco.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/core/jacoco.mk b/core/jacoco.mk index fa31fefe4..33d45d5e7 100644 --- a/core/jacoco.mk +++ b/core/jacoco.mk @@ -68,6 +68,7 @@ $(my_unzipped_timestamp_path): $(LOCAL_FULL_CLASSES_PRE_JACOCO_JAR) -d $(PRIVATE_UNZIPPED_PATH) \ $(PRIVATE_INCLUDE_ARGS) (cd $(PRIVATE_UNZIPPED_PATH) && rm -rf $(PRIVATE_EXCLUDE_ARGS)) + (cd $(PRIVATE_UNZIPPED_PATH) && find -not -name "*.class" -type f | xargs --no-run-if-empty rm) touch $(PRIVATE_UNZIPPED_TIMESTAMP_PATH) # Unfortunately in the previous task above, # 'rm -rf $(PRIVATE_EXCLUDE_ARGS)' needs to be a separate