title: Ant exec resultproperty is not working
body: <p>I am calling a batch file using an Ant <code>exec</code> task and setting the result in <code>resultpropery</code>. But the return value never comes to Ant. Below is my code</p>
  
  <pre><code>&lt;property name="BuildErrorCode" value="abc"/&gt;
  &lt;exec executable="cmd" resultproperty="BuildErrorCode" failonerror="false"
        dir="C:\workspace\build\"&gt;
      &lt;arg value="/c"/&gt;
      &lt;arg value="cmake_cross_compile.bat"/&gt;
  &lt;/exec&gt;
  
  &lt;echo message="Error Code:=${BuildErrorCode}" /&gt;
  </code></pre>
  
  <p>I exit my batch script by:    </p>
  
  <pre><code>if %errorlevel% neq 0 exit /b %errorlevel%
  </code></pre>
  
  <p>When the script runs, i always get <code>abc</code> as value instead of return value from batch file. My batch file returns <code>2</code> for now and I have to stop the build </p>
  
  <p>I want to do the following:</p>
  
  <ol>
  <li>If the return value is &lt;> 0 then i have to make the build fail which is not happening now.</li>
  </ol>
  
  <p>Any idea how I can get he return value and make the ant build fail?</p>