本文整理汇总了Java中edu.umd.cs.findbugs.ExitCodes类的典型用法代码示例。如果您正苦于以下问题:Java ExitCodes类的具体用法?Java ExitCodes怎么用?Java ExitCodes使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExitCodes类属于edu.umd.cs.findbugs包,在下文中一共展示了ExitCodes类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: afterExecuteJavaProcess
import edu.umd.cs.findbugs.ExitCodes; //导入依赖的package包/类
@Override
protected void afterExecuteJavaProcess(int rc) {
if ((rc & ExitCodes.ERROR_FLAG) != 0) {
throw new BuildException("Execution of findbugs failed.");
}
if ((rc & ExitCodes.MISSING_CLASS_FLAG) != 0) {
log("Classes needed for analysis were missing");
}
if (warningsProperty != null && (rc & ExitCodes.BUGS_FOUND_FLAG) != 0) {
getProject().setProperty(warningsProperty, "true");
}
if (outputFileName != null) {
log("Output saved to " + outputFileName);
}
}
示例2: execute
import edu.umd.cs.findbugs.ExitCodes; //导入依赖的package包/类
@Override
public void execute() throws BuildException {
findbugsEngine = (Java) getProject().createTask("java");
findbugsEngine.setTaskName(getTaskName());
findbugsEngine.setFork(true);
if (timeout > 0) {
findbugsEngine.setTimeout(timeout);
}
if (debug) {
jvmargs = jvmargs + " -Dfindbugs.debug=true";
}
findbugsEngine.createJvmarg().setLine(jvmargs);
if (homeDir != null) {
// Use findbugs.home to locate findbugs.jar and the standard
// plugins. This is the usual means of initialization.
File findbugsLib = new File(homeDir, "lib");
File findbugsLibFindBugs = new File(findbugsLib, "findbugs.jar");
File findBugsFindBugs = new File(homeDir, "findbugs.jar");
// log("executing using home dir [" + homeDir + "]");
if (findbugsLibFindBugs.exists())
findbugsEngine.setClasspath(new Path(getProject(), findbugsLibFindBugs.getPath()));
else if (findBugsFindBugs.exists())
findbugsEngine.setClasspath(new Path(getProject(), findBugsFindBugs.getPath()));
else
throw new IllegalArgumentException("Can't find findbugs.jar in " + homeDir);
findbugsEngine.setClassname("edu.umd.cs.findbugs.LaunchAppropriateUI");
findbugsEngine.createJvmarg().setValue("-Dfindbugs.home=" + homeDir.getPath());
} else {
// Use an explicitly specified classpath and list of plugin Jars
// to initialize. This is useful for other tools which may have
// FindBugs installed using a non-standard directory layout.
findbugsEngine.setClasspath(classpath);
findbugsEngine.setClassname("edu.umd.cs.findbugs.LaunchAppropriateUI");
addArg("-pluginList");
addArg(pluginList.toString());
}
if (projectFile != null) {
addArg("-project");
addArg(projectFile.getPath());
}
if (loadbugs != null) {
addArg("-loadbugs");
addArg(loadbugs.getPath());
}
if (look != null) {
addArg("-look:" + look);
// addArg("-look");
// addArg(look);
}
// findbugsEngine.setClassname("edu.umd.cs.findbugs.gui.FindBugsFrame");
log("Launching FindBugs Viewer...");
int rc = findbugsEngine.executeJava();
if ((rc & ExitCodes.ERROR_FLAG) != 0) {
throw new BuildException("Execution of findbugs failed.");
}
if ((rc & ExitCodes.MISSING_CLASS_FLAG) != 0) {
log("Classes needed for analysis were missing");
}
}