Gert Driesen wrote:
Dean,
I agree that this should indeed by the behaviour of the <delete> task, and
I've brought this change up several times.
Perhaps now would be a good time to decide once and for all, and clearly
document it.
Should we modify the <delete> task to no longer fail if the file or
directory does not exist (and document it as a breaking change in the
release notes) ? What do you (meaning other members of the NAnt community)
think ?
I agree, for all the reasons already mentioned, plus one more viewpoint:
With a system such as NAnt, which must pay careful attention to success
or failure at each step, it's useful to think in terms of pre- and
post-conditions. For most tasks, there's an obvious assertion that
could be the postcondition, and it should be the postcondition unless
there's a compelling reason to do something else. So, for example, the
postcondition for this is ${not directory::exists(theDirectory)} (and
the obvious generalization for deleting a fileset with multiple files
and directories). If this condition is true when the task is done, then
the task has succeeded - whether or not the items actually existed
beforehand. If an explicit item is missing, it should be a warning, not
an error. Similarly, for mkdir the postcondition is
${directory::exists(theDirectory)}. For copy, it's trickier:
${file::exists(sourceFile) and file::exists(targetFile) and
file::identical(sourceFile, targetFile) and file::up-to-date(sourceFile,
targetFile)}, where I had to invent "file::identical."
Gary
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users