Hi experts!

Is there a way to search for a file matching a condition and assign it to a
variable ?

Basically I want something like :

<task dir="c:\mydir" filter="commons-io-*.jar" output_variable="my_variable"
/>

my_variable should contain the list of jar files in C:\mydir that match the
pattern "commons-io-*.jar".

In my project, since C:\mydir will contain only one file matching
commons-io-*.jar my_variable will effectively contain only one file name.

My actual requirement :
copy the commons io jar ( now  commons-io-1.3.2.jar ) to commons-io.jar.
The jar may get updated over time with the newer version of commons io, but
i should not need to have to change the ant build.xml.
I thought I could get this done if I managed to capture the name of the
commons-io-*.jar in a variable and passed it as a parameter to <copy> task.

Is there a way to accomplish this ?
Any pointers is greatly appreciated.

thanks in advance,
Hari

Reply via email to