use of org.gradle.api.reporting.ReportingExtension in project gradle by gradle.
the class CompareGradleBuildsPlugin method apply.
public void apply(Project project) {
project.getPluginManager().apply(ReportingBasePlugin.class);
final ReportingExtension reportingExtension = project.getExtensions().findByType(ReportingExtension.class);
project.getTasks().withType(CompareGradleBuilds.class, new Action<CompareGradleBuilds>() {
@Override
public void execute(final CompareGradleBuilds task) {
((IConventionAware) task).getConventionMapping().map("reportDir", new Callable<File>() {
@Override
public File call() throws Exception {
return reportingExtension.file(task.getName());
}
});
}
});
project.getTasks().create("compareGradleBuilds", CompareGradleBuilds.class);
}
use of org.gradle.api.reporting.ReportingExtension 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);
}
use of org.gradle.api.reporting.ReportingExtension in project gradle by gradle.
the class JsHintPlugin method apply.
public void apply(Project project) {
project.getPluginManager().apply(RhinoPlugin.class);
project.getPluginManager().apply(ReportingBasePlugin.class);
JavaScriptExtension jsExtension = project.getExtensions().getByType(JavaScriptExtension.class);
final JsHintExtension jsHintExtension = ((ExtensionAware) jsExtension).getExtensions().create(JsHintExtension.NAME, JsHintExtension.class);
final Configuration configuration = addConfiguration(project.getConfigurations(), project.getDependencies(), jsHintExtension);
ConventionMapping conventionMapping = ((IConventionAware) jsHintExtension).getConventionMapping();
conventionMapping.map("js", new Callable<Configuration>() {
public Configuration call() {
return configuration;
}
});
conventionMapping.map("version", new Callable<String>() {
public String call() {
return JsHintExtension.DEFAULT_DEPENDENCY_VERSION;
}
});
final RhinoExtension rhinoExtension = ((ExtensionAware) jsExtension).getExtensions().getByType(RhinoExtension.class);
final ReportingExtension reportingExtension = project.getExtensions().getByType(ReportingExtension.class);
project.getTasks().withType(JsHint.class, new Action<JsHint>() {
public void execute(final JsHint task) {
task.getConventionMapping().map("rhinoClasspath", new Callable<FileCollection>() {
public FileCollection call() {
return rhinoExtension.getClasspath();
}
});
task.getConventionMapping().map("jsHint", new Callable<FileCollection>() {
public FileCollection call() {
return jsHintExtension.getJs();
}
});
task.getConventionMapping().map("jsonReport", new Callable<File>() {
public File call() {
return reportingExtension.file(task.getName() + "/report.json");
}
});
}
});
}
Aggregations