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
diff --git a/core/jacoco.mk b/core/jacoco.mk
index fa31fef..33d45d5e 100644
--- a/core/jacoco.mk
+++ b/core/jacoco.mk
@@ -68,6 +68,7 @@
-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