You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by JohnA <jo...@arrizza.com> on 2001/09/21 04:57:42 UTC

multiple filesets in a task

I am writing a taskdef that requires two FileSets. I need to distinguish
between them. I am currently using the description= attribute. I do not want
to get into using position i.e. the first fileset vs the second fileset.

Is there a better technique?

John


Re: multiple filesets in a task

Posted by Peter Donald <do...@apache.org>.
On Fri, 21 Sep 2001 12:57, JohnA wrote:
> I am writing a taskdef that requires two FileSets. I need to distinguish
> between them. I am currently using the description= attribute. I do not
> want to get into using position i.e. the first fileset vs the second
> fileset.
>
> Is there a better technique?

just using different names ? ie. createX(), createY(), addX(), addY()

See the War task which has different names like <webinf/>, <fileset>, <lib> 
etc.

-- 
Cheers,

Pete

----------------------------------
   "Don't play dumb with me. 
I happen to be an expert at that" 
           - Maxwell Smart
----------------------------------


RE: multiple filesets in a task

Posted by JohnA <jo...@arrizza.com>.
> -----Original Message-----
> From: Conor MacNeill [mailto:conor@cortexebusiness.com.au]
> Yes, use different addXXX methods to add the filesets
> Have a look at the war task in Ant for an example of this in practice.

I tried this an hour ago and it did not work. Now it works. Go figure.

Thanks!

John

RE: multiple filesets in a task

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
> From: JohnA [mailto:john.mlist1@arrizza.com]
> 
> I am writing a taskdef that requires two FileSets. I need to distinguish
> between them. I am currently using the description= attribute. I 
> do not want
> to get into using position i.e. the first fileset vs the second fileset.
> 
> Is there a better technique?
> 

Yes, use different addXXX methods to add the filesets

public void addXFileset(Fileset fs) {
...
}

and 

public void addYFileset(Fileset fs) {
...
}

Then you have

<mytask>
   <xfileset ...>
   <yfileset ...>
</mytask>

Have a look at the war task in Ant for an example of this in practice.

Conor