Search in sources :

Example 1 with JacocoAgentJar

use of org.gradle.internal.jacoco.JacocoAgentJar in project gradle by gradle.

the class JacocoPlugin method apply.

public void apply(ProjectInternal project) {
    project.getPluginManager().apply(ReportingBasePlugin.class);
    this.project = project;
    addJacocoConfigurations();
    JacocoAgentJar agent = instantiator.newInstance(JacocoAgentJar.class, project);
    JacocoPluginExtension extension = project.getExtensions().create(PLUGIN_EXTENSION_NAME, JacocoPluginExtension.class, project, agent);
    extension.setToolVersion(DEFAULT_JACOCO_VERSION);
    final ReportingExtension reportingExtension = (ReportingExtension) project.getExtensions().getByName(ReportingExtension.NAME);
    ((IConventionAware) extension).getConventionMapping().map("reportsDir", new Callable<File>() {

        @Override
        public File call() {
            return reportingExtension.file("jacoco");
        }
    });
    configureAgentDependencies(agent, extension);
    configureTaskClasspathDefaults(extension);
    applyToDefaultTasks(extension);
    configureDefaultOutputPathForJacocoMerge();
    configureJacocoReportsDefaults(extension);
    addDefaultReportAndCoverageVerificationTasks(extension);
}
Also used : ReportingExtension(org.gradle.api.reporting.ReportingExtension) JacocoAgentJar(org.gradle.internal.jacoco.JacocoAgentJar) File(java.io.File)

Aggregations

File (java.io.File)1 ReportingExtension (org.gradle.api.reporting.ReportingExtension)1 JacocoAgentJar (org.gradle.internal.jacoco.JacocoAgentJar)1