antmacrodef

Checkup for exact content of folder (no more, no less folders/files)


I have few directories where I need to verify that these directories contain exact list of files and directories and if there are some files or directories more or less is should say so. The very essential thing is that available task is not enough for me because I need to know not just if all files exists, but also if there aren't some more which shouldn't be there.

I would like to do so with macrodef task where I could define list of files and directories (I have more of them, so macrodef seems to be the best solution), but I have a problem with checking for both types - directories and files at once. Any idea how to do so?

I didn't find any similar examples of macrodef and would appreciate all your help. Thanks


Solution

  • You can check if all files exist with available task, then count all the files on the given directory with resourcecount task. If it is equals to the number of files you expected, it is OK.

    You'll need to set fileset and dirset for the Resource Collection.