use of org.gradle.reporting.HtmlReportBuilder in project gradle by gradle.
the class DefaultTestReport method generateFiles.
private void generateFiles(AllTestResults model, final TestResultsProvider resultsProvider, File reportDir) {
try {
HtmlReportRenderer htmlRenderer = new HtmlReportRenderer();
htmlRenderer.render(model, new ReportRenderer<AllTestResults, HtmlReportBuilder>() {
@Override
public void render(final AllTestResults model, final HtmlReportBuilder output) throws IOException {
buildOperationProcessor.run(new Action<BuildOperationQueue<HtmlReportFileGenerator<? extends CompositeTestResults>>>() {
@Override
public void execute(BuildOperationQueue<HtmlReportFileGenerator<? extends CompositeTestResults>> queue) {
queue.add(generator("index.html", model, new OverviewPageRenderer(), output));
for (PackageTestResults packageResults : model.getPackages()) {
queue.add(generator(packageResults.getBaseUrl(), packageResults, new PackagePageRenderer(), output));
for (ClassTestResults classResults : packageResults.getClasses()) {
queue.add(generator(classResults.getBaseUrl(), classResults, new ClassPageRenderer(resultsProvider), output));
}
}
}
});
}
}, reportDir);
} catch (Exception e) {
throw new GradleException(String.format("Could not generate test report to '%s'.", reportDir), e);
}
}
use of org.gradle.reporting.HtmlReportBuilder in project gradle by gradle.
the class HtmlDependencyReporter method render.
@Override
public void render(final Set<Project> projects, File outputDirectory) {
this.outputDirectory = outputDirectory;
HtmlReportRenderer renderer = new HtmlReportRenderer();
renderer.render(projects, new ReportRenderer<Set<Project>, HtmlReportBuilder>() {
@Override
public void render(Set<Project> model, HtmlReportBuilder builder) {
Transformer<String, Project> htmlPageScheme = projectNamingScheme("html");
Transformer<String, Project> jsScheme = projectNamingScheme("js");
ProjectPageRenderer projectPageRenderer = new ProjectPageRenderer(jsScheme);
builder.renderRawHtmlPage("index.html", projects, new ProjectsPageRenderer(htmlPageScheme));
for (Project project : projects) {
String jsFileName = jsScheme.transform(project);
generateJsFile(project, jsFileName);
String htmlFileName = htmlPageScheme.transform(project);
builder.renderRawHtmlPage(htmlFileName, project, projectPageRenderer);
}
}
}, outputDirectory);
}
Aggregations