ANT:fileset中使用exclude
2007-11-20 13:23
在Ant中使用copy任务是如果要忽略一些文件就需要使用fileset和excludes

复制一个目录中所有.java为结尾的文件,除去文件名含有Test字符的文件
<target name="copyfiles">       
        <copy todir="${dest.dir}" overwrite="true">
           <fileset dir="${src.dir}">
               <include name="**/*.java"/>
             <exclude name="**/*Test*"/>
           </fileset>
        </copy>
</target>

复制一个目录中所有文件,除去含有Test字符的目录
<target name="copyfiles">       
        <copy todir="${dest.dir}" overwrite="true">
           <fileset dir="${src.dir}">
             <exclude name="**/*Test*/**"/>
           </fileset>
        </copy>
</target>
需要加/**

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
  • 2021-06-14
  • 2021-05-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案