本文整理汇总了Java中org.apache.tools.ant.BuildEvent.setMessage方法的典型用法代码示例。如果您正苦于以下问题:Java BuildEvent.setMessage方法的具体用法?Java BuildEvent.setMessage怎么用?Java BuildEvent.setMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.BuildEvent
的用法示例。
在下文中一共展示了BuildEvent.setMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processAnsiColor
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
private void processAnsiColor(final BuildEvent event) {
String message = event.getMessage();
if (message == null) {
return;
}
message = message.replace(END_COLOR, "");
message = removeLeadingChars(message, "\b ");
Integer priorityOverride = getPriorityOverride(message);
if (!message.startsWith(PREFIX)) {
event.setMessage(message, getPriority(event.getPriority(), priorityOverride));
return;
}
int mIndex = message.indexOf(SUFFIX);
if (mIndex < 0) {
event.setMessage(message, getPriority(event.getPriority(), priorityOverride));
return;
}
String attribute = message.substring(PREFIX.length(), mIndex);
int priority = getPriority(attribute);
message = message.substring(mIndex + 1);
event.setMessage(message, getPriority(priority, priorityOverride));
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:23,代码来源:HybrisAnsiAntLogger.java
示例2: 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();
}
}
示例3: 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();
}
示例4: messageLogged
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
@Override
public void messageLogged(BuildEvent event) {
String msg = event.getMessage();
boolean processed = false;
if (!tasks.isEmpty()) {
Task task = tasks.peek();
for (MessageKind messageKind : task.msgs) {
if (messageKind.matches(msg)) {
event.setMessage(msg, messageKind.priority);
processed = true;
if (messageKind == MessageKind.JAVAC_CRASH) {
crashFound = true;
}
break;
}
}
}
if (event.getPriority() == MSG_ERR || crashFound) {
//we log errors regardless of owning task
logger.messageLogged(event);
suppressTaskFailures = true;
} else if (processed) {
logger.messageLogged(event);
}
}