use of org.gradle.reporting.HtmlReportRenderer 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.HtmlReportRenderer in project gradle by gradle.
the class ProfileReportRenderer method writeTo.
public void writeTo(BuildProfile buildProfile, File file) {
HtmlReportRenderer renderer = new HtmlReportRenderer();
renderer.renderSinglePage(buildProfile, new ProfilePageRenderer(), file);
}
use of org.gradle.reporting.HtmlReportRenderer in project gradle by gradle.
the class DefaultTestReport method generateFiles.
private void generateFiles(AllTestResults model, final TestResultsProvider resultsProvider, final File reportDir) {
try {
HtmlReportRenderer htmlRenderer = new HtmlReportRenderer();
buildOperationExecutor.run(new RunnableBuildOperation() {
@Override
public void run(BuildOperationContext context) {
// Clean-up old HTML report directories
GFileUtils.deleteQuietly(new File(reportDir, "packages"));
GFileUtils.deleteQuietly(new File(reportDir, "classes"));
}
@Override
public BuildOperationDescriptor.Builder description() {
return BuildOperationDescriptor.displayName("Delete old HTML results");
}
});
htmlRenderer.render(model, new ReportRenderer<AllTestResults, HtmlReportBuilder>() {
@Override
public void render(final AllTestResults model, final HtmlReportBuilder output) throws IOException {
buildOperationExecutor.runAll(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.HtmlReportRenderer in project gradle by gradle.
the class BuildDashboardGenerator method render.
@Override
public void render(Collection<Report> reports, final File outputFile) {
this.reports = new TreeSet<Report>(new Comparator<Report>() {
@Override
public int compare(Report o1, Report o2) {
return o1.getDisplayName().compareTo(o2.getDisplayName());
}
});
this.reports.addAll(reports);
this.outputFile = outputFile;
HtmlReportRenderer renderer = new HtmlReportRenderer();
renderer.renderRawSinglePage(reports, new ReportRenderer<Collection<Report>, HtmlPageBuilder<Writer>>() {
@Override
public void render(Collection<Report> model, HtmlPageBuilder<Writer> builder) {
generate(builder);
}
}, outputFile);
}
use of org.gradle.reporting.HtmlReportRenderer 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