ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <>
Subject Re: Determining empty fileset
Date Thu, 08 Dec 2005 05:35:21 GMT
Kamal Bhatt wrote:

> I know that I can use path convert to determine if a fileset is empty
> or not, but I don't know how or how to use the property from pathconvert.
Hello Kamal,

use the setonempty attribute of pathconvert, with the value "false".
This way, if the fileset is empty, the property will not be set.
this is good since targets check with their if attribut whether a
property is set or not.

so you do something like :
<fileset dir="foo/bar" id="myfileset"/>
<target name="fileset.check">
    <pathconvert refid="myfileset" property="fileset.notempty"
<target name="main" depends="fileset.check" if="fileset.nonempty">
    <!-- your main work goes here -->



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message