删除Ant中的多个目录

时间:2011-02-22 16:33:22

标签: java java-ee ant

我想从ant目标中删除目录而不用硬编码有多少目录。到目前为止,我有这个:

<target name="clean">

    <delete includeemptydirs="true">
            <fileset dir="${src.dir}">
                <include name="${clean.dirs}"/>
            </fileset>
        </delete>

</target>

将属性设置为:

src.dir=./src
clean.dirs=./com/webservices/resources/jaxws;./com/asdf/entity;./com/asdf/service

这似乎不起作用......我该怎么办?

1 个答案:

答案 0 :(得分:2)

试试这个: -

<delete includeemptydirs="true">
    <fileset dir="${src.dir}" includes="${clean.dirs}"/>
</delete>

属性文件: -

src.dir=./src
clean.dirs=**/com/webservices/resources/jaxws,**/com/asdf/entity,**/com/asdf/service