ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hariharasudhan R" <har...@gmail.com>
Subject Re: Is there a way to search for a file matching a condition and assign it to a variable ?
Date Tue, 15 Jan 2008 19:49:58 GMT
Hi Brian,

I am using JDK 5.0u14 and Ant 1.6.5 on Windows XP.
And I cannot move to Ant 1.7.0 since this is a big project and I would have
to convince a lot of people.
( I can add other third party tasks if necessary though )

And Gilbert's solution worked on Ant 1.6.5.

regards,
Hari


On Jan 16, 2008 1:14 AM, Brian Bassett <bbassett@insightful.com> wrote:

> This works for me with Ant 1.7.0.  What version are you using?
>
> Brian
>
> -----Original Message-----
> From: Hariharasudhan R [mailto:hari19@gmail.com]
> Sent: Tuesday, January 15, 2008 11:41 AM
> To: Ant Users List
> Subject: Re: Is there a way to search for a file matching a condition and
> assign it to a variable ?
>
> Hi Brian,
>
> Unfortunately that did not work.
> pathconvert does not take a nested fileset .
>
> thanks,
> Hari
>
> On Jan 16, 2008 12:54 AM, Brian Bassett <bbassett@insightful.com> wrote:
>
> > I'd take a look at <pathconvert>, probably something like this:
> >
> > <pathconvert property="my_variable">
> >  <fileset dir="C:\mydir" includes="commons-io-*.jar" />
> > </pathconvert>
> >
> > Brian
> >
> > -----Original Message-----
> > From: Hariharasudhan R [mailto:hari19@gmail.com]
> > Sent: Tuesday, January 15, 2008 11:15 AM
> > To: Ant Users List
> > Subject: Is there a way to search for a file matching a condition and
> > assign
> > it to a variable ?
> >
> > 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
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message