Diane just answered that one today, related to something else... She's
amazing ;-)

But, doesn't <javac> handle the fact that there's no sources to compile OK?
Have you tried it? --DD

-----Original Message-----
From:   Diane Holt [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, March 20, 2002 1:57 PM
To:     Ant Users List
Subject:        RE: Test if directory is empty

--- Dominique Devienne <[EMAIL PROTECTED]> wrote:
> Haven't tried it myself, but from the doc I would say that <pathconvert>
> would have converted your fileset the way you wanted. FWIW, --DD

Yep -- <pathconvert> will turn a fileset into a printable list. And you
could use it, in combination with <condition>, to test for an empty
directory -- eg:

  <fileset dir="foodir" id="fs"/>

  <target name="doit" depends="chkdir" unless="noFiles">
    <echo message="files = ${files}"/>
  </target>

  <target name="chkdir">
    <pathconvert pathsep="," property="files" refid="fs"/>
    <condition property="noFiles">
      <equals arg1="${files}" arg2=""/>
    </condition>
  </target>

Diane

=====
([EMAIL PROTECTED])


 -----Original Message-----
From:   Zart Colwing [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, March 20, 2002 3:23 PM
To:     [EMAIL PROTECTED]
Subject:        how to test existance of file based on pattern

I have the following need that I couldn't work out by myself so far:
- In order to fire a target I need to make sure at least one Test*.java 
exist anywhere in my test source hierarchy.

Naively I tried the following rule, but without success because 
<available/> is only capable of testing the existence of a single well 
know file at once. <available/> does not support file pattern !

<target name = "test_cases.exists">
        <!-- check that at least one Test*.java exist anywhere in the test 
source hierarchy -->
        <available file = "${src.test}/**/Test*.java" type = "file" 
property = "test_cases_exists"/>
</target>

Any idea, any body.

Thanks
ZC.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to