Java 类org.gradle.api.reporting.SingleFileReport 实例源码

项目:Reer    文件:JDependPlugin.java   
private void configureReportsConventionMapping(JDepend task, final String baseName) {
    task.getReports().all(new Action<SingleFileReport>() {
        @Override
        public void execute(final SingleFileReport report) {
            ConventionMapping reportMapping = conventionMappingOf(report);
            reportMapping.map("enabled", new Callable<Boolean>() {
                @Override
                public Boolean call() {
                    return report.getName().equals("xml");
                }
            });
            reportMapping.map("destination", new Callable<File>() {
                @Override
                public File call() {
                    final String fileSuffix = report.getName().equals("text") ? "txt" : report.getName();
                    return new File(extension.getReportsDir(), baseName + "." + fileSuffix);
                }
            });
        }
    });
}
项目:Reer    文件:FindBugsPlugin.java   
private void configureReportsConventionMapping(FindBugs task, final String baseName) {
    task.getReports().all(new Action<SingleFileReport>() {
        @Override
        public void execute(final SingleFileReport report) {
            ConventionMapping reportMapping = conventionMappingOf(report);
            reportMapping.map("enabled", new Callable<Boolean>() {
                @Override
                public Boolean call() {
                    return report.getName().equals("xml");
                }
            });
            reportMapping.map("destination", new Callable<File>() {
                @Override
                public File call() {
                    return new File(extension.getReportsDir(), baseName + "." + report.getName());
                }
            });
        }
    });
}
项目:Reer    文件:CodeNarcPlugin.java   
private void configureReportsConventionMapping(CodeNarc task, final String baseName) {
    task.getReports().all(new Action<SingleFileReport>() {
        @Override
        public void execute(final SingleFileReport report) {
            ConventionMapping reportMapping = AbstractCodeQualityPlugin.conventionMappingOf(report);
            reportMapping.map("enabled", new Callable<Boolean>() {
                @Override
                public Boolean call() {
                    return report.getName().equals(extension.getReportFormat());
                }
            });
            reportMapping.map("destination", new Callable<File>() {
                @Override
                public File call() {
                    String fileSuffix = report.getName().equals("text") ? "txt" : report.getName();
                    return new File(extension.getReportsDir(), baseName + "." + fileSuffix);
                }
            });
        }
    });
}
项目:gradle-circle-style    文件:CircleStylePlugin.java   
private void configureFindbugsTask(
        final Project project,
        final FindBugs findbugsTask,
        final String circleReportsDir,
        final StyleTaskTimer timer) {
    // Ensure XML output is enabled
    findbugsTask.doFirst(new Action<Task>() {
        @Override
        public void execute(Task task) {
            for (SingleFileReport report : findbugsTask.getReports()) {
                report.setEnabled(false);
            }
            FindBugsXmlReport xmlReport = (FindBugsXmlReport) findbugsTask.getReports().findByName("xml");
            xmlReport.setEnabled(true);
            xmlReport.setWithMessages(true);
        }
    });

    // Configure the finalizer task
    CircleStyleFinalizer finalizer = createTask(
            project.getTasks(),
            findbugsTask.getName() + "CircleFinalizer",
            CircleStyleFinalizer.class);
    if (finalizer == null) {
        // Already registered (happens if the user applies us to the root project and subprojects)
        return;
    }
    finalizer.setReportParser(FindBugsReportHandler.PARSER);
    finalizer.setStyleTask(findbugsTask);
    finalizer.setReporting(findbugsTask);
    finalizer.setStyleTaskTimer(timer);
    finalizer.setTargetFile(new File(
            new File(circleReportsDir, "findbugs"),
            project.getName() + "-" + findbugsTask.getName() + ".xml"));

    findbugsTask.finalizedBy(finalizer);
}
项目:gradle-circle-style    文件:CircleStyleFinalizerTests.java   
private Checkstyle createCheckstyleTask(Project project) throws IOException {
    Checkstyle checkstyle = project.getTasks().create("checkstyleTest", Checkstyle.class);
    SingleFileReport xmlReport = checkstyle.getReports().getByName("xml");

    String originalReportXml = readTestFile("two-namecheck-failures-checkstyle.xml");
    String modifiedReportXml = originalReportXml.replace(ROOT.toString(), projectDir.getRoot().getCanonicalPath().toString());
    File modifiedReportFile = projectDir.newFile();
    Files.write(modifiedReportXml, modifiedReportFile, UTF_8);

    xmlReport.setDestination(modifiedReportFile);
    return checkstyle;
}
项目:Reer    文件:PmdPlugin.java   
private void configureReportsConventionMapping(Pmd task, final String baseName) {
    task.getReports().all(new Action<SingleFileReport>() {
        @Override
        public void execute(final SingleFileReport report) {
            ConventionMapping reportMapping = AbstractCodeQualityPlugin.conventionMappingOf(report);
            reportMapping.map("enabled", Callables.returning(true));
            reportMapping.map("destination", new Callable<File>() {
                @Override
                public File call() {
                    return new File(extension.getReportsDir(), baseName + "." + report.getName());
                }
            });
        }
    });
}
项目:Reer    文件:CheckstylePlugin.java   
private void configureReportsConventionMapping(Checkstyle task, final String baseName) {
    task.getReports().all(new Action<SingleFileReport>() {
        @Override
        public void execute(final SingleFileReport report) {
            ConventionMapping reportMapping = conventionMappingOf(report);
            reportMapping.map("enabled", Callables.returning(true));
            reportMapping.map("destination", new Callable<File>() {
                @Override
                public File call() {
                    return new File(extension.getReportsDir(), baseName + "." + report.getName());
                }
            });
        }
    });
}
项目:Reer    文件:FindBugs.java   
@VisibleForTesting
void evaluateResult(FindBugsResult result) {
    if (result.getException() != null) {
        throw new GradleException("FindBugs encountered an error. Run with --debug to get more information.", result.getException());
    }

    if (result.getErrorCount() > 0) {
        throw new GradleException("FindBugs encountered an error. Run with --debug to get more information.");
    }

    if (result.getBugCount() > 0) {
        String message = "FindBugs rule violations were found.";
        SingleFileReport report = reports.getFirstEnabled();
        if (report != null) {
            String reportUrl = new ConsoleRenderer().asClickableFileUrl(report.getDestination());
            message += " See the report at: " + reportUrl;
        }

        if (getIgnoreFailures()) {
            getLogger().warn(message);
        } else {
            throw new GradleException(message);
        }

    }

}
项目:Reer    文件:CodeNarcReportsImpl.java   
public CodeNarcReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
}
项目:Reer    文件:FindBugsReportsImpl.java   
public FindBugsReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(FindBugsXmlReportImpl.class, "xml", task);
    add(CustomizableHtmlReportImpl.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
    add(TaskGeneratedSingleFileReport.class, "emacs", task);
}
项目:Pushjet-Android    文件:CodeNarcReportsImpl.java   
public CodeNarcReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
}
项目:Pushjet-Android    文件:FindBugsReportsImpl.java   
public FindBugsReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(FindBugsXmlReportImpl.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
    add(TaskGeneratedSingleFileReport.class, "emacs", task);
}
项目:Pushjet-Android    文件:CodeNarcReportsImpl.java   
public CodeNarcReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
}
项目:Pushjet-Android    文件:FindBugsReportsImpl.java   
public FindBugsReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(FindBugsXmlReportImpl.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
    add(TaskGeneratedSingleFileReport.class, "emacs", task);
}
项目:gradle-circle-style    文件:CircleStyleFinalizer.java   
public Reporting<? extends ReportContainer<SingleFileReport>> getReporting() {
    return reporting;
}
项目:gradle-circle-style    文件:CircleStyleFinalizer.java   
public void setReporting(Reporting<? extends ReportContainer<SingleFileReport>> reporting) {
    this.reporting = reporting;
}
项目:Reer    文件:PmdReportsImpl.java   
public PmdReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "xml", task);
}
项目:Reer    文件:PmdReportsImpl.java   
public SingleFileReport getHtml() {
    return getByName("html");
}
项目:Reer    文件:PmdReportsImpl.java   
public SingleFileReport getXml() {
    return getByName("xml");
}
项目:Reer    文件:CheckstyleReportsImpl.java   
public CheckstyleReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(CustomizableHtmlReportImpl.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "xml", task);
}
项目:Reer    文件:CheckstyleReportsImpl.java   
public SingleFileReport getHtml() {
    return getByName("html");
}
项目:Reer    文件:CheckstyleReportsImpl.java   
public SingleFileReport getXml() {
    return getByName("xml");
}
项目:Reer    文件:FindBugsReportsInternal.java   
@Internal
SingleFileReport getFirstEnabled();
项目:Reer    文件:JDependReportsImpl.java   
public JDependReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
}
项目:Reer    文件:JDependReportsImpl.java   
public SingleFileReport getXml() {
    return getByName("xml");
}
项目:Reer    文件:JDependReportsImpl.java   
public SingleFileReport getText() {
    return getByName("text");
}
项目:Reer    文件:CodeNarcReportsImpl.java   
public SingleFileReport getXml() {
    return getByName("xml");
}
项目:Reer    文件:CodeNarcReportsImpl.java   
public SingleFileReport getHtml() {
    return getByName("html");
}
项目:Reer    文件:CodeNarcReportsImpl.java   
public SingleFileReport getText() {
    return getByName("text");
}
项目:Reer    文件:FindBugsReportsImpl.java   
public SingleFileReport getHtml() {
    return getByName("html");
}
项目:Reer    文件:FindBugsReportsImpl.java   
public SingleFileReport getText() {
    return getByName("text");
}
项目:Reer    文件:FindBugsReportsImpl.java   
public SingleFileReport getEmacs() {
    return getByName("emacs");
}
项目:Reer    文件:JacocoReportsContainerImpl.java   
public SingleFileReport getXml() {
    return (SingleFileReport)getByName("xml");
}
项目:Reer    文件:JacocoReportsContainerImpl.java   
public SingleFileReport getCsv() {
    return (SingleFileReport)getByName("csv");
}
项目:Pushjet-Android    文件:PmdReportsImpl.java   
public PmdReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "xml", task);
}
项目:Pushjet-Android    文件:PmdReportsImpl.java   
public SingleFileReport getHtml() {
    return getByName("html");
}
项目:Pushjet-Android    文件:PmdReportsImpl.java   
public SingleFileReport getXml() {
    return getByName("xml");
}
项目:Pushjet-Android    文件:CheckstyleReportsImpl.java   
public CheckstyleReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "xml", task);
}
项目:Pushjet-Android    文件:CheckstyleReportsImpl.java   
public SingleFileReport getXml() {
    return getByName("xml");
}
项目:Pushjet-Android    文件:JDependReportsImpl.java   
public JDependReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
}