I was asked to create a cleanup target using NAnt that would remove files left over by the various other targets in the build file. The main file has nearly a thousand lines with well over a hundred targets, so I'd rather not add the call to the cleanup target manually to each. On the other hand I'd rather automate it for the users of this build, so they don't have to run the same NAnt target every time they use any other target.
Is there any way to have a NAnt target trigger when a target in the build ends, or any other way of automating this process through NAnt?
A coworker found the documentation on it, not where I expected to find it. However the following properties made it work:
<property name="nant.onsuccess" value="targetGoesHere" />
<property name="nant.onfailure" value="targetGoesHere" />