com.uber.infer.task.InferAnalyzeCommand.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infer-plugin Show documentation
Show all versions of infer-plugin Show documentation
Gradle integration for infer static analyzer.
The newest version!
package com.uber.infer.task
import com.uber.infer.util.RunCommandUtils
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
/**
* Base class for running different Infer analyzers.
*/
public abstract class InferAnalyzeCommand extends DefaultTask {
@TaskAction
def analyze() {
def outputDir = new File(project.getBuildDir(), "infer-out")
def result = RunCommandUtils.run("infer -a ${getAnalyzerName()} --fail-on-bug --out "
+ " ${outputDir.absolutePath} -- analyze", project.getProjectDir())
println result.stdout
if (!result.success) {
throw new RuntimeException("Infer analysis found issues.")
}
}
/**
* @return the analyzer the task should run.
*/
protected abstract String getAnalyzerName();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy