I have a specific build variant that is ONLY used for mock testing. I'd prefer not to run unit tests against this variant (but want to run them against other variants). Is there any way to inform gradle to skip unit testing for this specific variant?
In my case I wanted to skip all unit testing from the release variant. It can be achieved doing this:
gradle.taskGraph.useFilter { task ->
if (task.name.startsWith("test") && task.name.contains("ReleaseUnitTest")) {
return false;
}
return true;
}
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