本文整理汇总了Java中org.apache.tools.ant.BuildEvent.setException方法的典型用法代码示例。如果您正苦于以下问题:Java BuildEvent.setException方法的具体用法?Java BuildEvent.setException怎么用?Java BuildEvent.setException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.BuildEvent
的用法示例。
在下文中一共展示了BuildEvent.setException方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildPlugins
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void buildPlugins() {
BuildException be = null;
try {
BuildEvent startEvent = new BuildEvent(_builderProject);
if (_cleanOnly) {
startEvent.setMessage("CLEAN STARTED",0);
} else {
startEvent.setMessage("BUILD STARTED",0);
}
_pbListener.buildStarted(startEvent);
_antBuilder.execute();
} catch (BuildException e) {
be = e;
} finally {
BuildEvent endEvent = new BuildEvent(_builderProject);
if (be != null) {
endEvent.setException(be);
}
_pbListener.buildFinished(endEvent);
_pbListener.cleanup();
}
}
示例2: taskFinished
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
@Override
public void taskFinished(BuildEvent event) {
if (tasks.peek() == Task.ROOT) {
//we need to 'close' the root task to get nicer output
logger.taskFinished(event);
} else if (!suppressTaskFailures && event.getException() != null) {
//the first (innermost) task failure should always be logged
event.setMessage(event.getException().toString(), 0);
event.setException(null);
//note: we turn this into a plain message to avoid stack trace being logged by Idea
logger.messageLogged(event);
suppressTaskFailures = true;
}
tasks.pop();
}