Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You use the <a href="http://ant.apache.org/manual/Tasks/available.html" rel="noreferrer">available</a> task with type set to "dir".</p> <p>For example:</p> <pre><code>&lt;available file="${dir}" type="dir"/&gt; </code></pre> <p>The standard way to do conditional processing is with the <a href="http://ant.apache.org/manual/Tasks/condition.html" rel="noreferrer">condition task</a>. In the example below, running doFoo will echo a message if the directory exists, whereas running doBar will echo a message <em>unless</em> the directory exists.</p> <p>The <em>dir.check</em> target is required by both doFoo and doBar, it sets the <em>dir.exists</em> property to true or false depending on the result of the available task. The doFoo target will only run if that propery is set to true and doBar will only run if it is not set or set to false.</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;project name="test" default="doFoo" basedir="."&gt; &lt;property name="directory" value="c:\test\directory"/&gt; &lt;target name="doFoo" depends="dir.check" if="dir.exists"&gt; &lt;echo&gt;${directory} exists&lt;/echo&gt; &lt;/target&gt; &lt;target name="doBar" depends="dir.check" unless="dir.exists"&gt; &lt;echo&gt;${directory} missing"&lt;/echo&gt; &lt;/target&gt; &lt;target name="dir.check"&gt; &lt;condition property="dir.exists"&gt; &lt;available file="${directory}" type="dir"/&gt; &lt;/condition&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p><a href="http://antelope.tigris.org/" rel="noreferrer">Antelope</a> provides additional tasks, including an If task that can make the processing simpler (and to me, more intuitive), you can download the Antelope tasks from the <a href="http://antelope.tigris.org/servlets/ProjectDocumentList" rel="noreferrer">download page</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload