The jacoco plugin provides a task jacocoTestCoverageVerification which fails the build if the coverage is below some configured threshold. However, the plugin only runs if some *.exec file exists, which is created during test execution. If the subproject doesn’t have any test, this file is not created, causing the verification task to be skipped. This is implemented using a file check with onlyIf:
I’d like to think that having no test is a special case of having 0% code coverage, and I’d like to fail my build if that is the case. How can I override the onlyIf in the plugin task definition? Is this a bug worth fixing in Gradle’s code?