title: Ant: how to fail if property contains a certain string
body: <p>I want to write an ant macro that will call the fail task if the supplied attribute contains a certain string. The only way that I know how to do string comparison in ant is by using javascript. I have something like this:</p>
  
  <pre><code>&lt;macrodef name="check-for-error"&gt;
      &lt;attribute name="input"/&gt;
      &lt;sequential&gt;
          &lt;echo message="@{input}"/&gt;
          &lt;script language="javascript"&gt;
              &lt;![CDATA[
              var response= "@{input}";
              if(response.indexOf("FAIL") !=-1){
                  project.setProperty("error","true");
              }
              ]]&gt;
          &lt;/script&gt;
          &lt;fail message="INPUT FAILED" if="${error}"/&gt;
      &lt;/sequential&gt;
  &lt;/macrodef&gt;
  </code></pre>
  
  <p>The problem with this approach is that I'm setting a property that is global inside of the javascript, and ant does not let you reset a property. I know ant has the ability to set local properties. How can I access local properties from within javascript? Or is there a better way to do this all together?</p>