Search in sources :

Example 1 with FindBugsResult

use of org.gradle.api.plugins.quality.internal.findbugs.FindBugsResult in project gradle by gradle.

the class FindBugs method run.

@TaskAction
public void run() throws IOException, InterruptedException {
    new FindBugsClasspathValidator(JavaVersion.current()).validateClasspath(Iterables.transform(getFindbugsClasspath().getFiles(), new Function<File, String>() {

        @Override
        public String apply(File input) {
            return input.getName();
        }
    }));
    FindBugsSpec spec = generateSpec();
    FindBugsWorkerManager manager = new FindBugsWorkerManager();
    getLogging().captureStandardOutput(LogLevel.DEBUG);
    getLogging().captureStandardError(LogLevel.DEBUG);
    FindBugsResult result = manager.runWorker(getProject().getProjectDir(), getWorkerProcessBuilderFactory(), getFindbugsClasspath(), spec);
    evaluateResult(result);
}
Also used : Function(com.google.common.base.Function) FindBugsSpec(org.gradle.api.plugins.quality.internal.findbugs.FindBugsSpec) FindBugsWorkerManager(org.gradle.api.plugins.quality.internal.findbugs.FindBugsWorkerManager) FindBugsClasspathValidator(org.gradle.api.plugins.quality.internal.findbugs.FindBugsClasspathValidator) File(java.io.File) FindBugsResult(org.gradle.api.plugins.quality.internal.findbugs.FindBugsResult) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

Function (com.google.common.base.Function)1 File (java.io.File)1 FindBugsClasspathValidator (org.gradle.api.plugins.quality.internal.findbugs.FindBugsClasspathValidator)1 FindBugsResult (org.gradle.api.plugins.quality.internal.findbugs.FindBugsResult)1 FindBugsSpec (org.gradle.api.plugins.quality.internal.findbugs.FindBugsSpec)1 FindBugsWorkerManager (org.gradle.api.plugins.quality.internal.findbugs.FindBugsWorkerManager)1 TaskAction (org.gradle.api.tasks.TaskAction)1