jacoco-android-gradle-plugin
jacoco-android-gradle-plugin copied to clipboard
Jacoco Task taking forever
The Jacoco Task sometimes takes forever to run. Sometimes, it runs immediately and other times, it just gets stuck doing the same task over and over again. You can see the gradle task in the picture below. The gradle file (slimmed down to important info) looks like: build.gradle Project Level
buildscript {
dependencies {
classpath('com.dicedmelon.gradle:jacoco-android:0.1.3') { exclude group: 'org.codehaus.groovy', module: 'groovy-all' }
}
}
build.gradle App Level
apply plugin: 'jacoco-android'
android {
testOptions {
animationsDisabled true
unitTests {
includeAndroidResources = true
}
unitTests.all {
jvmArgs '-noverify'
jacoco {
includeNoLocationClasses = true
}
}
}
}
jacocoAndroidUnitTestReport {
csv.enabled true
html.enabled false
xml.enabled false
}
@bschnack could you try again with 0.1.4?
So far that seems to have worked. However, we still see that the Jacoco task takes a while to run. Is there a way to only have it run with a certain command line argument or improve that time?
Thanks, Brian
I am seeing similar behavior with 0.1.4. It only happens intermittently but occasionally I'll the jacocoDevDebug job running for 5 to 10 minutes.
I've tried below approach:
-
gradle.startParameter.excludedTaskNames += "jacocoDevelopDebug"
in custom task, or overwriting it, e.g:
// kotlin gradle
task.replace("assemble[Flavour]Debug").doLast {
gradle.startParameter.excludedTaskNames += "jacoco[Flavour]Debug"
}
// groovy gradle
task jar(overwrite: true) {
gradle.startParameter.excludedTaskNames += "jacoco[Flavour]Debug"
}
See original issue here & here (about kotlin gradle)
- Using parameter in command line, e.g:
./gradlew -PnoLint
// or
./gradlew -x lint
See original article here & here
- Flagging based on command line argument & separating jacoco task gradle file
if (System.getProperty("myJacocoArguments").toBoolean()) {
apply: jacoco.gradle
}
- Disable test coverage on local development, and run only on jenkins/CI server
testCoverageEnabled (project.hasProperty('coverage') ? true : false)
This is happening to me, but I'm not even using this plugin. I'm using https://github.com/vanniktech/gradle-android-junit-jacoco-plugin
This is still happening for 50 per cent of the build. Any way to fix this or to get rid of the plugin all together?
Unfortunately this issue is still happening. Has anyone been able to find a workaround?