当前位置: 首页>>代码示例>>Java>>正文


Java ExitCodes类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:17,代码来源:FindBugsTask.java

示例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");
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:75,代码来源:FindBugsViewerTask.java


注:本文中的edu.umd.cs.findbugs.ExitCodes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。