org.gradle.api.reporting.ReportContainer Java Examples
The following examples show how to use
org.gradle.api.reporting.ReportContainer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReportUploader.java From nomulus with Apache License 2.0 | 5 votes |
@SuppressWarnings("unchecked") private static Reporting<? extends ReportContainer<? extends Report>> asReporting(Task task) { if (task instanceof Reporting) { return (Reporting<? extends ReportContainer<? extends Report>>) task; } return null; }
Example #2
Source File: DefaultReportContainer.java From pushfish-android with BSD 2-Clause "Simplified" License | 4 votes |
public ReportContainer<T> configure(Closure cl) { ConfigureUtil.configure(cl, this, false); return this; }
Example #3
Source File: DefaultReportContainer.java From pushfish-android with BSD 2-Clause "Simplified" License | 4 votes |
public ReportContainer<T> configure(Closure cl) { ConfigureUtil.configure(cl, this, false); return this; }
Example #4
Source File: ReportUploader.java From nomulus with Apache License 2.0 | 4 votes |
/** * Converts a Gradle Task into a TaskData. * * @param rootDir the root directory of the main Project - used to get the relative path of any * Task files. */ private TaskData createTaskData(Task task, Path rootDir) { TaskData.State state = task.getState().getFailure() != null ? TaskData.State.FAILURE : task.getState().getUpToDate() ? TaskData.State.UP_TO_DATE : TaskData.State.SUCCESS; String log = logs.get(task.getPath()).toString(); TaskData.Builder builder = TaskData.builder() .setState(state) .setUniqueName(task.getPath()) .setDescription( Optional.ofNullable(task.getDescription()).orElse("[No description available]")); if (!log.isEmpty()) { builder.setLog(toByteArraySupplier(log)); } Reporting<? extends ReportContainer<? extends Report>> reporting = asReporting(task); if (reporting != null) { // This Task is also a Reporting task! It has a destination file/directory for every supported // format. // Add the files for each of the formats into the ReportData. reporting .getReports() .getAsMap() .forEach( (type, report) -> { File destination = report.getDestination(); // The destination could be a file, or a directory. If it's a directory - the Report // could have created multiple files - and we need to know to which one of those to // link. // // If we're lucky, whoever implemented the Report made sure to extend // DirectoryReport, which gives us the entry point to all the files. // // This isn't guaranteed though, as it depends on the implementer. Optional<File> entryPointHint = destination.isDirectory() && (report instanceof DirectoryReport) ? Optional.ofNullable(((DirectoryReport) report).getEntryPoint()) : Optional.empty(); builder .reportsBuilder() .put(type, readFilesWithEntryPoint(destination, entryPointHint, rootDir)); }); } return builder.build(); }
Example #5
Source File: DefaultReportContainer.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
public ReportContainer<T> configure(Closure cl) { ConfigureUtil.configure(cl, this, false); return this; }
Example #6
Source File: DefaultReportContainer.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
public ReportContainer<T> configure(Closure cl) { ConfigureUtil.configure(cl, this, false); return this; }