# ant-user mailing list archives

##### Site index · List index
Message view
Top
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Using Classpath as copy Source
Date Sun, 14 Jan 2007 15:30:38 GMT
```Failing that (i.e. if you can't upgrade for corporate
reasons or something) ant-contrib has a task
(pathtofileset?) that will create a fileset from a
path for paths whose constituent elements share a
common ancestor.  Of course, if you weren't allowed to
upgrade Ant, you're probably not allowed to use new
3rd-party libraries either.  ;)

-Matt

--- Michael Franz <mvfranz@gmail.com> wrote:

> Thanks, I will take a look at that.  I have not used
> the 1.7 version.
>
> On 1/13/07, Matt Benson <gudnabrsam@yahoo.com>
> wrote:
> >
> > In Ant 1.7.0 <copy> can use any resource
> collection,
> > including a <path>, as its source.  In the
> manual's
> > "Concepts and Types" section, look for
> "Resources".
> >
> > HTH,
> > Matt
> >
> > --- Michael Franz <mvfranz@gmail.com> wrote:
> >
> > > I have been searching for an answer to this for
> a
> > > few days and have not
> > > found the solution.  I would think it is easy (I
> > > hope it is) and I have just
> > > missed the solution.
> > >
> > > What I want to do is copy every jar that is on
> my
> > > classpath into a
> > > directory.  From my understanding copy does not
> work
> > > with paths, so how can
> > > I convert the path into a fileset or some other
> > > structure that copy will
> > > understand?  One thing to note is that the jars
> are
> > > in different directories
> > > and the full paths are specified in the
> classpath.
> > >
> > > What I want is something like this.
> > >
> > > classpath=c:\library1\a.jar;c:\library2\b.jar
> > >
> > > <copy todir="\${my.lib.dir}" flatten="yes">
> > >  <fileset ... convert my path to work/>
> > > </copy>
> > >
> > > I have tried using pathconvert, but I don't know
> how
> > > that will help.  The
> > > other problem with the fileset and filelist is
> that
> > > they require a dir
> > > attribute, but since there is not specific dir
> the
> > > value is useless.
> > >
> > > What I ended up doing is using beanshell to
> iterate
> > > over my path and copy
> > > the files individually, but I would like to use
> > > something simpler (if it
> > > exists).
> > >
> > > Thanks
> > >
> > > Michael
> > >
> >
> >
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Yahoo! Music Unlimited
> > Access over 1 million songs.
> > http://music.yahoo.com/unlimited
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> user-help@ant.apache.org
> >
> >
>

____________________________________________________________________________________