Search in sources :

Example 1 with JacocoCoverageVerification

use of org.gradle.testing.jacoco.tasks.JacocoCoverageVerification in project gradle by gradle.

the class JacocoPlugin method addDefaultCoverageVerificationTask.

private void addDefaultCoverageVerificationTask(final Test task) {
    final JacocoCoverageVerification coverageVerificationTask = project.getTasks().create("jacoco" + StringUtils.capitalize(task.getName()) + "CoverageVerification", JacocoCoverageVerification.class);
    coverageVerificationTask.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP);
    coverageVerificationTask.setDescription(String.format("Verifies code coverage metrics based on specified rules for the %s task.", task.getName()));
    coverageVerificationTask.executionData(task);
    coverageVerificationTask.sourceSets(project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().getByName("main"));
}
Also used : JavaPluginConvention(org.gradle.api.plugins.JavaPluginConvention) JacocoCoverageVerification(org.gradle.testing.jacoco.tasks.JacocoCoverageVerification)

Aggregations

JavaPluginConvention (org.gradle.api.plugins.JavaPluginConvention)1 JacocoCoverageVerification (org.gradle.testing.jacoco.tasks.JacocoCoverageVerification)1