arturdm / jacoco-android-gradle-plugin

Gradle plugin that creates JaCoCo test reports for Android unit tests
Apache License 2.0
563 stars 111 forks source link

Android databind generated classes are not excluded #69

Open haobin opened 5 years ago

haobin commented 5 years ago

The generated classes for databind are in different paths than what is expected by the plugin. Following is the paths based on the android databind codelab project.

./app/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/example/android/databinding/basicsample/databinding/SolutionBindingImpl.class ./app/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/example/android/databinding/basicsample/databinding/PlainActivitySolution5BindingImpl.class ./app/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/example/android/databinding/basicsample/databinding/PlainActivitySolution4BindingImpl.class

Jacoco Android gradle plugin excludes "*/android/databinding/.class", so it doesn't really exclude the generated classes above.

JesseScott commented 5 years ago

I think this should be as simple as adding '**/*databinding/**/*.*' to the fileFilter...

JesseScott commented 5 years ago

Wait. They should be as of https://github.com/arturdm/jacoco-android-gradle-plugin/blob/master/src/main/groovy/com/dicedmelon/gradle/jacoco/android/JacocoAndroidUnitTestReportExtension.groovy