ant iterate over files

走远了吗. 提交于 2019-12-06 07:48:41
Vladimir

Just use zipgroupfileset with the Ant Zip task

<zip destfile="out.jar">
    <zipgroupfileset dir="lib" includes="*.jar"/>
</zip>

This will flatten all included jar libraries' content.

VonC

If you do not have access to ant-contrib For task, you may end up to have to define your custom Task for doing what you need...

If you have ant1.6 and above, you can also try subant (see New Ant 1.6 Features for Big Projects):

If you use <subant>'s genericantfile attribute it kind of works like <antcall> invoking a target in the same build file that contains the task.
Unlike <antcall>, <subant> takes a list or set of directories and will invoke the target once for each directory setting the project's base directory.

This is useful if you want to perform the exact same operation in an arbitrary number of directories.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!