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


Java BuildEvent.getProject方法代码示例

本文整理汇总了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());
}
 
开发者ID:apache,项目名称:ant,代码行数:22,代码来源:BigProjectLogger.java

示例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.");
}
 
开发者ID:apache,项目名称:ant-easyant-tasks,代码行数:20,代码来源:DebuggerListener.java

示例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();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:NbBuildLogger.java

示例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);
		}
	}
}
 
开发者ID:drftpd-ng,项目名称:drftpd3,代码行数:16,代码来源:PluginBuildListener.java

示例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;
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:38,代码来源:Log4jListener.java

示例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());
}
 
开发者ID:apache,项目名称:ant-easyant-core,代码行数:11,代码来源:MultiModuleLogger.java

示例7: init

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void init(BuildEvent event) {
	project = event.getProject();
	project.log("Attaching DebuggerListener to the build.");

}
 
开发者ID:apache,项目名称:ant-easyant-tasks,代码行数:6,代码来源:DebuggerListener.java

示例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();
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:15,代码来源:RecorderEntry.java

示例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();
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:12,代码来源:Recorder.java


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