Java Code Examples for org.gradle.api.reporting.SingleFileReport

The following examples show how to use org.gradle.api.reporting.SingleFileReport. These examples are extracted from open source projects. 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
public CodeNarcReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
}
 
Example 2
public CodeNarcReportsImpl(Task task) {
    super(SingleFileReport.class, task);

    add(TaskGeneratedSingleFileReport.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
}
 
Example 3
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);
}
 
Example 4
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);
}
 
Example 5
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);
}
 
Example 6
Source Project: nohttp   Source File: NoHttpCheckstylePlugin.java    License: Apache License 2.0 4 votes vote down vote up
private void createCheckstyleTaskForProject(Configuration configuration) {
	Logger logger = this.logger;
	Project project = this.project;
	NoHttpExtension extension = this.extension;
	Checkstyle checkstyleTask = project
			.getTasks().create("checkstyleNohttp", Checkstyle.class);
	checkstyleTask.setDescription("Checks for illegal uses of http://");
	checkstyleTask.getReports().all(new Action<SingleFileReport>() {
		@Override
		public void execute(final SingleFileReport report) {
			String reportFileName = report.getDestination().getName();
			report.setDestination(project.getExtensions().getByType(ReportingExtension.class)
					.getBaseDirectory()
					.dir(checkstyleTask.getName())
					.map(reportDir -> reportDir.file(reportFileName).getAsFile())
			);
		}
	});
	ConventionMapping taskMapping = checkstyleTask.getConventionMapping();
	taskMapping.map("classpath", new Callable<FileCollection>() {
		@Override
		public FileCollection call() throws Exception {
			return configuration;
		}
	});
	taskMapping.map("source", new Callable<FileTree>() {
		@Override
		public FileTree call() throws Exception {
			return extension.getSource();
		}
	});
	boolean configureConfigLoc = configureConfigDirectory(checkstyleTask);
	taskMapping.map("configProperties", new Callable<Map<String, Object>>() {
		@Override
		public Map<String, Object> call() throws Exception {
			Map<String, Object> configProperties = new HashMap<>();
			File allowlistFile = extension.getAllowlistFile();
			if (allowlistFile != null) {
				logger.debug("Using allowlist at {}", allowlistFile);
				String allowlistPath = project.relativePath(allowlistFile);
				configProperties.put("nohttp.checkstyle.allowlistFileName", allowlistPath);
			}
			if (configureConfigLoc) {
				configProperties.put("config_loc", project.relativePath(getConfigLocation()));
			}
			return configProperties;
		}
	});
	taskMapping.map("config", new Callable<TextResource>() {
		@Override
		public TextResource call() throws Exception {
			File configLoc = getConfigLocation();
			File defaultCheckstyleFile = new File(configLoc, "checkstyle.xml");
			if (defaultCheckstyleFile.exists()) {
				logger.debug("Found default checkstyle configuration, so configuring checkstyleTask to use it");
				return project.getResources().getText().fromFile(defaultCheckstyleFile);
			}
			logger.debug("No checkstyle configuration provided, so using the default.");
			URL resource = getClass().getResource(
					"/io/spring/nohttp/checkstyle/default-nohttp-checkstyle.xml");
			return project.getResources().getText().fromUri(resource);
		}
	});
}
 
Example 7
public PmdReportsImpl(Task task) {
    super(SingleFileReport.class, task);
    
    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "xml", task);
}
 
Example 8
public SingleFileReport getHtml() {
    return getByName("html");
}
 
Example 9
public CheckstyleReportsImpl(Task task) {
    super(SingleFileReport.class, task);
    
    add(TaskGeneratedSingleFileReport.class, "xml", task);
}
 
Example 10
public JDependReportsImpl(Task task) {
    super(SingleFileReport.class, task);
    
    add(TaskGeneratedSingleFileReport.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
}
 
Example 11
public SingleFileReport getXml() {
    return getByName("xml");
}
 
Example 12
public SingleFileReport getText() {
    return getByName("text");
}
 
Example 13
public SingleFileReport getText() {
    return getByName("text");
}
 
Example 14
public SingleFileReport getHtml() {
    return getByName("html");
}
 
Example 15
public SingleFileReport getText() {
    return getByName("text");
}
 
Example 16
public SingleFileReport getXml() {
    return getByName("xml");
}
 
Example 17
public SingleFileReport getEmacs() {
    return getByName("emacs");
}
 
Example 18
public SingleFileReport getCsv() {
    return (SingleFileReport)getByName("csv");
}
 
Example 19
public SingleFileReport getXml() {
    return (SingleFileReport)getByName("xml");
}
 
Example 20
public PmdReportsImpl(Task task) {
    super(SingleFileReport.class, task);
    
    add(TaskGeneratedSingleFileReport.class, "html", task);
    add(TaskGeneratedSingleFileReport.class, "xml", task);
}
 
Example 21
public SingleFileReport getHtml() {
    return getByName("html");
}
 
Example 22
public SingleFileReport getText() {
    return getByName("text");
}
 
Example 23
public CheckstyleReportsImpl(Task task) {
    super(SingleFileReport.class, task);
    
    add(TaskGeneratedSingleFileReport.class, "xml", task);
}
 
Example 24
public SingleFileReport getXml() {
    return getByName("xml");
}
 
Example 25
public JDependReportsImpl(Task task) {
    super(SingleFileReport.class, task);
    
    add(TaskGeneratedSingleFileReport.class, "xml", task);
    add(TaskGeneratedSingleFileReport.class, "text", task);
}
 
Example 26
public SingleFileReport getText() {
    return getByName("text");
}
 
Example 27
public SingleFileReport getXml() {
    return getByName("xml");
}
 
Example 28
public SingleFileReport getCsv() {
    return (SingleFileReport)getByName("csv");
}
 
Example 29
public SingleFileReport getText() {
    return getByName("text");
}
 
Example 30
public SingleFileReport getHtml() {
    return getByName("html");
}