Question: I am trying to print some message in Ant depending on some condition as follow:

```
<if>
    <equals arg1="${docs.present}" arg2="true"/>
    <then>
    </then>
    <else>
        <echo message="No docss found!"/>
    </else>
</if>

```

But as you see, if docs.present property is set to 'true' then only I want to execute only else part. There is nothing to execute in if part. How can I achieve this?

Answer: 
You can use `echo` in your `if` condition instead of else as below :

```
<if>
    <equals arg1="${docs.present}" arg2="false"/>
    <then>
          <echo message="No docss found!"/>
    </then>
</if>

```
A native Ant solution would be to use conditional task execution:

```
<project name="demo" default="run">

   <available file="mydoc.txt" property="doc.present"/>

   <target name="run" unless="doc.present">
     <echo message="No docs found"/>
   </target>

</project>

```

The "if" task is not part of standard Ant.