1

I am looking for a means to have Ant check a target directory for the existence of files in a list/set defined by a source directory.

The Ant target only needs to determine if the files in a source directory also currently exist in the target directory. No copying/moving/deleting necessary.

Can this be done in Ant?

martin clayton
  • 76,436
  • 32
  • 213
  • 198

1 Answers1

1

Take a look at the Ant resource collection set operators. For example:

<fileset id="source" dir="source_dir" />
<fileset id="target" dir="target_dir" />

<difference id="difference">
    <resources refid="source"/>
    <resources refid="target"/>
</difference>

<echo message="${toString:difference}" />

You can use a dirset if you're only interested in directories.

martin clayton
  • 76,436
  • 32
  • 213
  • 198