ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murray, Mike" <...@ptc.com>
Subject RE: FileSet Scanning & Popluation
Date Fri, 31 Oct 2003 14:14:04 GMT
Thanks.  That is useful information, but it won't help me in this case since the multiple use
includes one time by my custom task, and the other times are by built-in tasks, such as copy,
zip, etc.

I think what I need a "scan once" option on FileSet.

Thanks, Mike

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Friday, October 31, 2003 1:15 AM
To: user@ant.apache.org
Subject: Re: FileSet Scanning & Popluation


On Thu, 30 Oct 2003, Mike Murray <mbm@ptc.com> wrote:

> Although a FileSet can be defined with an id for reuse, it appears
> that every time is is used it performs its scan.

Correct.

> Is there any way to have it scan and populate once, and then access
> it from multiple tasks?

Reuse the DirectoryScanner instance.

> I'm focusing on its getDirectoryScanner() method.

Because of this I assume that you are talking about tasks of your
own.  In the first task, do something like

getProject().addReference("my-ds-key", fs.getDirectoryScanner());

and when you want to reuse it in the other task

DirectoryScanner ds = (DirectoryScanner) getProject().getReference("my-ds-key");

So you don't ID the fileset but the DirectoryScanner itself.

Sorry, no built-in way to do that (yet?).

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message