如何格式化ant任务名称输出到控制台以包含项目名称?

时间:2014-05-02 06:38:30

标签: ant

开始了解ANT。我正在建立一个模块系统,我们有许多具有类似结构的子项目。

主项目有一个构建内容目标,然后在必要时调用每个子项目中的构建内容目标。

这导致三个“构建内容”消息输出到控制台(并且将会有更多,因为将来至少还有一个子项目要包括在内)。

是否有一个参数来格式化此消息,使其前缀为项目名称?

1 个答案:

答案 0 :(得分:2)

使用BigProjectLogger:

This logger is designed to make examining the logs of a big build easier, especially those run under continuous integration tools. It 
1.When entering a child project, prints its name and directory
2.When exiting a child project, prints its name
3.Includes the name of the project when printing a target
4.Omits logging the names of all targets that have no direct task output
5.Includes the build finished timestamp of the TimeStamp logger

This is useful when using <subant> to build a large project from many smaller projects -the output shows which particular project is building.

请参阅Ant Manual Listeners & Loggers