user2018791
user2018791

Reputation: 1153

ant to exclude some files

I am trying to use ant to copy files from sourceDir to destDir, and I also don't want to copy some files, I keep the file names I want to exclude in file: excludelist.txt. How could I implements this is an ant target ?

Upvotes: 0

Views: 1186

Answers (1)

Rebse
Rebse

Reputation: 10377

Use copy task with nested fileset using nested exludesfile.

From ant manual FileSet :

excludesfile => the name of a file; each line of this file is taken to be an exclude pattern.

snippet :

<target name="foo">
 <copy todir="path/to/destDir">
  <fileset dir="path/to/sourceDir">
   <excludesfile name="excludelist.txt"/>
  </fileset>
 </copy>
</target>

Upvotes: 2

Related Questions