更改 Ant输出中的 [exec] 标签任务
我正在使用 Ant 的
任务来执行使用
任务的多个同时目标,但很难读取输出,因为它是交错的。有没有办法更改每行输出之前出现的 [exec]
标签以使用命令或目标名称?
例如,在运行 pdepend
和 phpcpd
时,我想将 [exec]
更改为 [pdepend]
和 < code>[phpcpd]:
pdepend:
[exec] PHP_Depend 0.10.5 by Manuel Pichler
[exec]
phpcpd:
[exec] Parsing source files:
[exec] phpcpd 1.3.2 by Sebastian Bergmann.
[exec]
[exec] ............................................................ 60
[exec] Found 26 exact clones with 640 duplicated lines in 28 files:
[exec]
[exec] - application/modules/controllers/IndexController.php:16-31
[exec] ............................................................ 120
[exec] application/modules/controllers/ErrorController.php:15-30
[exec]
[exec] - application/modules/controllers/PhotosController.php:24-33
[exec] ............................................................ 180
[exec] ............................................................ 240
变成
pdepend:
[pdepend] PHP_Depend 0.10.5 by Manuel Pichler
[pdepend]
phpcpd:
[phpcpd] Parsing source files:
[phpcpd] phpcpd 1.3.2 by Sebastian Bergmann.
[phpcpd]
[pdepend] ............................................................ 60
[phpcpd] Found 26 exact clones with 640 duplicated lines in 28 files:
[phpcpd]
[phpcpd] - application/modules/controllers/IndexController.php:16-31
[pdepend] ............................................................ 120
[phpcpd] application/modules/controllers/ErrorController.php:15-30
[phpcpd]
[phpcpd] - application/modules/controllers/PhotosController.php:24-33
[pdepend] ............................................................ 180
[pdepend] ............................................................ 240
I am using Ant's <parallel>
task to perform multiple simultaneous targets that use <exec>
tasks, but it's difficult to read the output because it is interleaved. Is there any way to change the [exec]
label that appears before each line of output to use the command or target name?
For example, while running pdepend
and phpcpd
I would like to change [exec]
to [pdepend]
and [phpcpd]
:
pdepend:
[exec] PHP_Depend 0.10.5 by Manuel Pichler
[exec]
phpcpd:
[exec] Parsing source files:
[exec] phpcpd 1.3.2 by Sebastian Bergmann.
[exec]
[exec] ............................................................ 60
[exec] Found 26 exact clones with 640 duplicated lines in 28 files:
[exec]
[exec] - application/modules/controllers/IndexController.php:16-31
[exec] ............................................................ 120
[exec] application/modules/controllers/ErrorController.php:15-30
[exec]
[exec] - application/modules/controllers/PhotosController.php:24-33
[exec] ............................................................ 180
[exec] ............................................................ 240
becomes
pdepend:
[pdepend] PHP_Depend 0.10.5 by Manuel Pichler
[pdepend]
phpcpd:
[phpcpd] Parsing source files:
[phpcpd] phpcpd 1.3.2 by Sebastian Bergmann.
[phpcpd]
[pdepend] ............................................................ 60
[phpcpd] Found 26 exact clones with 640 duplicated lines in 28 files:
[phpcpd]
[phpcpd] - application/modules/controllers/IndexController.php:16-31
[pdepend] ............................................................ 120
[phpcpd] application/modules/controllers/ErrorController.php:15-30
[phpcpd]
[phpcpd] - application/modules/controllers/PhotosController.php:24-33
[pdepend] ............................................................ 180
[pdepend] ............................................................ 240
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过在
exec
任务上设置taskname
属性?我会在几个小时内仔细检查并确认。更新:
是的,
taskname
就可以了。例如,来自所有任务的通用属性:
Have you tried setting the
taskname
attribute on theexec
task? I'll double check in a couple of hours and confirm.Update:
Yep,
taskname
does the trick. e.g.,From Common Attributes of all Tasks: