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); }
public FindBugsXmlReport getXml() { return (FindBugsXmlReport) getByName("xml"); }
@Override public Boolean getWithMessagesFlag() { FindBugsXmlReport report = (FindBugsXmlReport)getEnabled().findByName("xml"); return report != null ? report.isWithMessages() : Boolean.FALSE; }
@Input @Optional public Boolean getWithMessagesFlag() { FindBugsXmlReport report = (FindBugsXmlReport)getEnabled().findByName("xml"); return report != null ? report.isWithMessages() : Boolean.FALSE; }