title: How to check two properties in an if condition of an Ant task?
body: <p>It is possible to execute an Ant target conditionally by specifying an <code>if</code> or <code>unless</code> clause. As far as I can see this clause accepts only one property. How can I check for two properties?</p>
  
  <p>This is an example:</p>
  
  <pre><code>&lt;project default="test"&gt;
    &lt;property name="a" value="true"/&gt;
    &lt;property name="b" value="true"/&gt;
    &lt;target name="test-a" if="a"&gt;
      &lt;echo&gt;a&lt;/echo&gt;
    &lt;/target&gt;
    &lt;target name="test-b" if="b"&gt;
      &lt;echo&gt;b&lt;/echo&gt;
    &lt;/target&gt;
    &lt;target name="test-ab" if="a,b"&gt;
      &lt;echo&gt;a and b&lt;/echo&gt;
    &lt;/target&gt;
    &lt;target name="test" depends="test-a,test-b,test-ab"/&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>If I run it, the <code>test-ab</code> target generates no output:</p>
  
  <pre>
  $ ant -f target-if.xml
  Buildfile: target-if.xml
  
  test-a:
       [echo] a
  
  test-b:
       [echo] b
  
  test-ab:
  
  test:
  
  BUILD SUCCESSFUL
  Total time: 0 seconds
  </pre>
  
  <p>How to specify an and expression for the two properties?</p>