| <?xml version="1.0"?> |
| <project name="project"> |
| <condition property="legal.directory"> |
| <matches pattern="^/[^/]+/.*" string="${directory}"/> |
| </condition> |
| <target name="do.clear.directory" if="legal.directory"> |
| <delete includeemptydirs="true" quiet="true"> |
| <fileset dir="${directory}" includes="**/*" defaultexcludes="false"/> |
| </delete> |
| </target> |
| <target name="dont.clear.directory" unless="legal.directory"> |
| <fail message="Directory "${directory}" is invalid"/> |
| </target> |
| <target name="clear.directory" depends="do.clear.directory,dont.clear.directory"/> |
| </project> |