ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Bernard <>
Subject RE: How obtain the number of files in a fileset ?
Date Wed, 06 Mar 2002 08:29:29 GMT
Not sure if this is the right course of action, but take a look at the
source for the <javac> task,  In particular look at the scanDir
method.  I think this might be leveraged to perform what you're looking for.
Unfortunately, it does not set any property, but I'm sure you can ,make it
do so, or perhaps create a new task that can do this.

-----Original Message-----
From: Gareth Thorburn []
Sent: Wednesday, March 06, 2002 12:00 AM
Subject: How obtain the number of files in a fileset ?


I'ld quite like to have a target which simply produces a count of the
number of .java files in my project.

Ideally, this would be a simple 'count' task which takes a
or something similar to the javac task and then sets a property value to the
result. I'ld like then to be able to echo out some text displaying this

The echo requirement is because I have a large build involving many
and generally run ant with the -quiet option, to provide neater more compact

I've seen previous posts which have found a solution using OS specific
calls but I'm not going to go down that route.

Any ideas ?



Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

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

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

View raw message