使用Ant,我想清理所有扩展名为“.dcu”的文件的目录,其中存在一个与扩展名为“.pas”的基本名称相同的文件.
我不能简单地删除所有’.dcu’文件 – 其中一些文件无法通过源代码编译来恢复,因为没有相应的’.pas’文件.
如何才能做到这一点?
您可以使用带有 globmapper
和
present
selector的文件集来执行此操作,例如:
<delete> <fileset dir="." includes="*.dcu"> <present targetdir="."> <mapper type="glob" from="*.dcu" to="*.pas" /> </present> </fileset> </delete>
精彩评论