ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: Set a property is source files exist.
Date Mon, 29 Mar 2004 08:04:36 GMT
You can use a mixture of pathconvert and condition:

    <mkdir dir="nofiles"/>
    <fileset id="empty" dir="nofiles" includes="**/*.java"/>
    <pathconvert property="nofiles.files" refid="empty" targetos="unix"/>
    <echo>nofile.files is ${nofiles.files}</echo>
    <condition property="files.present">
        <equals arg1="" arg2="${nofiles.files}"/>


Donald Strong wrote:

>Hi all,
>I want to set a property if a set of files is not empty.
>I can get the set of files using a FileSet but how do I
>then detect that the set is not empty?
>    <fileset id="" dir="${junit.test.source.dir}">
>        <include name="**/${junit.test.pattern}"/>
>    </fileset>
>I have tried setting a property in the hope that it worked like classpath
>but to no avail.
>    <property name="junit.test.source.list" refid=""/>
>    <echo> Source directory   = ${junit.test.source.list}</echo>
>[echo] Source directory   =
>I have tried <uptodate> and <outofdate> but they only care whether the
>target file is there. I don't have a target file. I have tried various
>permutations with and without a dummy target file, but no dice.
>Hit me with inspired suggestions, please!
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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

View raw message