Our builds always clean the build dir like this: <delete dir="build" /> However, I just deleted a couple of my applications, thanks to having a symlink to /Applications and Ant's default behaviour being to follow the symlinks. I now know that I have to do this to get safe behaviour (added in Bug 22632): <delete quiet="true" removeNotFollowedSymlinks="true"> <fileset dir="build" followsymlinks="false"/> </delete> I know that having the less useful defaults for tasks is something like an Ant culture, but in this particular case, the potential for damage is quite high, so I think that the default behaviour should be the safe behaviour.
This workaround of using removeNotFollowedSymlinks="true" doesn't appear to delete symlinks... so I'm not sure there is a real workaround without using <exec>. Currently we have to use rm directly. <exec executable="rm"> <arg value="-rf"/> <arg path="build"/> </exec>