title: if else condition in ant task produces error
body: <p>I have a scenario where i need to move a directory from one location to another. If the same directory exists in the destination folder i need to rename the directory name as oldname_1.
  So i wrote a snippet as follows:</p>
  
  <pre><code>&lt;target name="Move"&gt;
      &lt;IF&gt;
          &lt;available file="${output.dir}" type="dir" /&gt;
          &lt;then&gt;
              &lt;echo message="Directory exists" /&gt;
              &lt;rename src="${output.dir}" dest="${output.dir}_1"/&gt;
              &lt;property name="newdirectory" value="${dest}"/&gt;
          &lt;/then&gt;
      &lt;ELSE&gt;
          &lt;echo message="Directory does not exist" /&gt;
      &lt;/ELSE&gt;
      &lt;/IF&gt;
          &lt;move file="${newdirectory}" todir="C:\reports" /&gt;
      &lt;/target&gt;
  </code></pre>
  
  <p>The error i am getting is :</p>
  
  <pre>
  Problem: failed to create task
  Cause: The name is undefined.
  Action: Check the spelling.
  Action: Check that any custom tasks/types have been declared.
  Action: Check that any / declarations have taken place.
  </pre>