本文整理汇总了Java中org.apache.tools.ant.BuildEvent.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java BuildEvent.getProject方法的具体用法?Java BuildEvent.getProject怎么用?Java BuildEvent.getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.BuildEvent
的用法示例。
在下文中一共展示了BuildEvent.getProject方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: subBuildStarted
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*
* @param event An event with any relevant extra information. Must not be <code>null</code>.
*/
public void subBuildStarted(BuildEvent event) {
String name = extractNameOrDefault(event);
Project project = event.getProject();
File base = project == null ? null : project.getBaseDir();
String path =
(base == null)
? "With no base directory"
: "In " + base.getAbsolutePath();
printMessage(StringUtils.LINE_SEP + getHeader()
+ StringUtils.LINE_SEP + "Entering project " + name
+ StringUtils.LINE_SEP + path
+ StringUtils.LINE_SEP + getFooter(),
out,
event.getPriority());
}
示例2: buildStarted
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void buildStarted(BuildEvent event) {
// set audit property helper that will help keep track of properties
// being set everywhere.
project = event.getProject();
PropertyHelper helper = new PropertyDebugHelper();
helper.setProject(project);
auditor = new DefaultAuditor();
((PropertyDebugHelper) helper).setAuditor(auditor);
// Is it better to set it as a project helper or as a delegate to the
// helper?
project.addReference(MagicNames.REFID_PROPERTY_HELPER, helper);
commandHandler.setProject(project);
commandHandler.init(getDefaultCommandSupport());
prompt = new DebugPrompt(project, commandHandler);
auditor.setPrompt(prompt);
// this is how the debugging starts
prompt.prompt("Type /? to get any help.");
}
示例3: targetStarted
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public @Override void targetStarted(BuildEvent ev) {
AntBridge.suspendDelegation();
try {
checkForStop();
setLastTask(null);
AntEvent e = LoggerTrampoline.ANT_EVENT_CREATOR.makeAntEvent(new Event(ev, false));
LOG.log(Level.FINE, "targetStarted: {0}", e);
for (AntLogger l : getInterestedLoggersByEvent(e)) {
try {
l.targetStarted(e);
} catch (RuntimeException x) {
LOG.log(Level.WARNING, null, x);
}
}
// Update progress handle label so user can see what is being run.
Project p = ev.getProject();
String projectName = null;
if (p != null) {
projectName = p.getName();
}
String targetName = e.getTargetName();
if (targetName != null) {
String message;
if (projectName != null) {
message = NbBundle.getMessage(NbBuildLogger.class, "MSG_progress_target", projectName, targetName);
} else {
message = targetName;
}
/*
if (message.equals(displayName)) {
// Redundant in this case.
message = "";
}
*/
handle.progress(message);
}
} finally {
AntBridge.resumeDelegation();
}
}
示例4: subBuildStarted
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void subBuildStarted(BuildEvent be) {
Project p = be.getProject();
if (p != null) {
String name = p.getName();
if (name != null) {
PluginDescriptor currDescriptor = _pluginMap.get(name);
_isSlavePlugin = _slavePluginMap.containsKey(name);
p.setProperty("slave.plugin",String.valueOf(_isSlavePlugin));
p.addReference("plugin.descriptor",currDescriptor);
p.addReference("slave.fileset",_slaveFiles);
p.addReference("installed.confs",_installedConfs);
p.addReference("libs.missing",_missingLibs);
}
}
}
示例5: messageLogged
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
* @see BuildListener#messageLogged
* {@inheritDoc}.
*/
@Override
public void messageLogged(final BuildEvent event) {
Object categoryObject = event.getTask();
if (categoryObject == null) {
categoryObject = event.getTarget();
if (categoryObject == null) {
categoryObject = event.getProject();
}
}
final Logger log
= Logger.getLogger(categoryObject.getClass().getName());
switch (event.getPriority()) {
case Project.MSG_ERR:
log.error(event.getMessage());
break;
case Project.MSG_WARN:
log.warn(event.getMessage());
break;
case Project.MSG_INFO:
log.info(event.getMessage());
break;
case Project.MSG_VERBOSE:
log.debug(event.getMessage());
break;
case Project.MSG_DEBUG:
log.debug(event.getMessage());
break;
default:
log.error(event.getMessage());
break;
}
}
示例6: subBuildStarted
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void subBuildStarted(BuildEvent event) {
initTimer(event.getProject());
String name = extractNameOrDefault(event);
Project project = event.getProject();
File base = project == null ? null : project.getBaseDir();
String path = (base == null) ? "With no base directory" : "In " + base.getAbsolutePath();
printMessage(LINE_SEP + DEMARKER + LINE_SEP + "Entering project " + name
+ LINE_SEP + path + LINE_SEP + DEMARKER, out, event.getPriority());
}
示例7: init
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void init(BuildEvent event) {
project = event.getProject();
project.log("Attaching DebuggerListener to the build.");
}
示例8: subBuildFinished
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
* Cleans up any resources held by this recorder entry at the end
* of a subbuild if it has been created for the subbuild's project
* instance.
*
* @param event the buildFinished event
*
* @since Ant 1.6.2
*/
public void subBuildFinished(BuildEvent event) {
if (event.getProject() == project) {
cleanup();
}
}
示例9: subBuildFinished
import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
* Cleans recorder registry, if this is the subbuild the task has
* been created in.
* @param event ignored.
* @since Ant 1.7
*/
public void subBuildFinished(BuildEvent event) {
if (event.getProject() == getProject()) {
cleanup();
}
}