你看过吗
ant-contrib outofdate task
?
文档末尾的示例看起来像您可以使用的工具:
<outofdate property="manual.outofdate"
outputsources="grammer.sources">
<sourcefiles>
<fileset dir="${src.grammer}" includes="**/*.y"/>
</sourcefiles>
<mapper type="glob" dir="${src.grammer}" from="*.y" to="${gen.grammer}/*.c"/>
<mapper type="glob" dir="${src.grammer}" from="*.y" to="${gen.grammer}/*.h"/>
<sequential>
<shellscript shell="bash">
cd ${gen.grammer}
for g in ${grammer.sources}
do
gengrammer $g
done
</shellscript>
</sequential>
</outofdate>
还要注意,您可能会使用
ant-contrib "for" task
在尸体里
outofdate
任务。
要初始化ant contrib,请执行以下操作:
<property name="ant-contrib.jar" location="..."/>
<taskdef
resource="net/sf/antcontrib/antlib.xml"
uri="http://ant-contrib.sourceforge.net"
>
<classpath>
<pathelement location="${ant-contrib.jar}"/>
</classpath>
</taskdef>