Apache Ant:关闭特定任务的输出
我有一个包含不同任务的构建文件。其中一些是内部任务,我可以控制生成的日志记录/输出的数量。
其他任务是我无法控制的库。它们没有提供控制输出量的方法。有一项非常琐碎的任务,我很乐意完全关闭该任务的输出。
我的问题是是否有办法关闭 ant 执行中的特定任务输出。或者 ant 是否提供了一种方法将此任务包装在另一个将 echo 设置为“关闭”或类似内容的任务中?
-赛姆
I have a build file that has different variety of tasks. Some of these are in-house tasks that I am able to control the amount of logging/output generated.
The other tasks are libraries that I have no control over. They do not provide a way to control the amount of output. There is one very trivial task and I am comfortable with turning off the output of the task all together.
My question is if there a way to turn off this specific tasks output in the ant execution. Or does ant provide a way to wrap this task in another task that has echo set to 'off' or something similar?
-Syam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Ant 没有内置功能来关闭特定任务的输出,但可以通过构建监听器实现。请参阅在没有 -q 标志的情况下让 ant 安静? 获取答案
Ant has no builtin feature to turn off output for specific task, but there are possibilities via buildlisteners. See Make ant quiet without the -q flag? for answers
outputproperty="devnull"
它对我来说工作得很好,如果需要的话,你总是可以打印这个变量。
outputproperty="devnull"
It works fine for me and allways you can print this var if you need.