We have Jacoco running, but have noticed that Jacoco runs in the normal Android Studio build (such as pressing "Run" to deploy changes). This adds an unnecessary amount of time into the build time. I would rather only run Jacoco on demand (by an explicit gradle task) rather than have it included in every Android Studio build.

jacoco.gradle:
apply plugin: 'jacoco-android'
jacocoAndroidUnitTestReport {
csv.enabled true
html.enabled false
xml.enabled false
}
app.gradle:
android {
testOptions {
animationsDisabled true
unitTests {
includeAndroidResources = true
}
unitTests.all {
jvmArgs '-noverify'
jacoco {
includeNoLocationClasses = true
}
}
}
}
apply from: "jacoco.gradle"
this is coming from apply plugin: 'jacoco-android' ...it's not the default behavior.
if you'd define the task in jacoco.gradle, this should not happen, unless explicitly running the task.
or you could try do disable the generation of the task (possibly this has to be per flavor dev):
android {
buildTypes {
debug {
testCoverageEnabled false
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With