當前位置: 首頁>>代碼示例>>Java>>正文


Java BuildException.printStackTrace方法代碼示例

本文整理匯總了Java中org.apache.tools.ant.BuildException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java BuildException.printStackTrace方法的具體用法?Java BuildException.printStackTrace怎麽用?Java BuildException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.tools.ant.BuildException的用法示例。


在下文中一共展示了BuildException.printStackTrace方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: modulesBuild

import org.apache.tools.ant.BuildException; //導入方法依賴的package包/類
/** Execute targets which can fail _without_ throwing BuildException */
private void modulesBuild() throws BuildException {
    if ( ! failonerror ) {
        // build the rest of modules
        for (String module : buildmodules) {
            dummy = new Target ();
            dummyName = "nbmerge-" + getOwningTarget().getName() + "-" + module;
            while (targets.contains (dummyName))
                dummyName += "-x";
            dummy.setName (dummyName);
            dummy.addDependency (targetprefix + module);
            getProject().addTarget(dummy);
            @SuppressWarnings("unchecked")
            Vector<Target> fullList = getProject().topoSort(dummyName, targets);
            // Now remove earlier ones: already done.
            @SuppressWarnings("unchecked")
            Vector<Target> doneList = getProject().topoSort(getOwningTarget().getName(), targets);
            List<Target> todo = new ArrayList<>(fullList.subList(0, fullList.indexOf(dummy)));
            todo.removeAll(doneList.subList(0, doneList.indexOf(getOwningTarget())));
            
            Iterator<Target> targit = todo.iterator();
            try {
                while (targit.hasNext()) {
                    Target nexttargit = targit.next();
                    String targetname = nexttargit.getName();
                    if ( builttargets.indexOf(targetname) < 0 ) {
                        System.out.println(); System.out.println(targetname + ":");
                        nexttargit.execute();
                        builttargets.addElement(targetname);
                    }
                    
                }
                builtmodules.addElement(module);
            } catch (BuildException BE) {
                    log(BE.toString(), Project.MSG_WARN);
                    BE.printStackTrace();
                    failedmodules.addElement(module);
            }
        }
        log("builtmodules=" + builtmodules, Project.MSG_VERBOSE);
        log("failedmodules=" + failedmodules, Project.MSG_VERBOSE);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:44,代碼來源:NbMerge.java


注:本文中的org.apache.tools.ant.BuildException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。