我怎样才能触发Ant任务只有当输入大于输出的更新? [英] How can I trigger an ant task only if input is newer than output?
问题描述
我在Java中的生成过程中,我需要使用Ant EXEC
任务启动外部程序。然后,该外部程序将创建基于抽象规范一些消息来源,即一种code产生。
I have a build process in Java where I need to use the Ant exec
task to launch an external program. That external program will then create some sources based on an abstract specification, i.e. a kind of code generation.
我怎样才能获得 EXEC
任务来执行仅在的输入的到code一代比新的输出的?即当输入输出最后一次创建之后被修改?
How can I get the exec
task to execute only if the input to the code generation is newer than the output? I.e. when the input has been modified after the output was last created?
推荐答案
因为我想指定目标文件的任意集(这与最新考量
的繁琐或不可能只使用Ant进行多个目标文件的映射
元素),我结束了使用蚂蚁的contrib
的其中支持我想要的东西更直观OutOfDate 任务。
Since I wanted to specify an arbitrary set of target files (which is cumbersome or impossible with Uptodate
that only uses the Ant mapper
element for multiple target files), I ended up using the ant-contrib
OutOfDate task which supported what I wanted more intuitively.
这篇关于我怎样才能触发Ant任务只有当输入大于输出的更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!