I am trying to generate jacoco reports for unit and instrumentation tests for my android project using this plugin com.vanniktech:gradle-android-junit-jacoco-plugin:0.16.0
. On running gradle build
it automatically runs instrumentation tests using tasks combinedTestReport<Flavor><BuildType>
. How can I prevent this from running during build, so that build does not fail even if I do not have a device connected. I want to run these tasks separately at convenience.
Asked
Active
Viewed 888 times
0

Jon
- 21
- 4
-
Does this answer your question? [How can I disable a task in build.gradle](https://stackoverflow.com/questions/47192746/how-can-i-disable-a-task-in-build-gradle) – Lukas Körfer Aug 13 '20 at 00:28
-
I tried this, but it does not work. As far as I understand, it will only skip the task if build does not have a dependency on it. But running gradle build triggers the task when the plugin is applied. – Jon Aug 13 '20 at 01:36
-
Were you able to accomplish this? I have a similar problem with gradle-nuget-plugin 2.18. NuGetPush task defined within the plugin has a duplicate variable name which is conflicting with Gradle 6.x variables. Unfortunately being behind corporate firewall, I am unable to upgrade nuget-plugin or downgrade gradle. – Sree Sake Mar 09 '21 at 00:30
-
For my particular case, downgrading the jacoco plugin worked. – Jon Mar 16 '21 at 10:02