Mitch,

The filterset implementation currently does not allow for other types of
filters to be set, that's what the filterchain support was intended for.

I'm not sure on how to proceed with this, we could rework the filterset
implementation (which, right now, is more or less a port of the Ant
filterset) to allow custom filtersets but this would actually mean that the
filterset implementation is moving toward a filterchain implementation
(which is not bad ofcourse) ....

It would change the build layout of the filtersets considerately ofcourse
... It would also mean that we would not be able to use the Element
initialization code that we use for all other types, as this would mean that
we'd need have a separate property for each possible type of filterreader in
the filterchain, and this would prevent further extensibility by third
parties ...

Ant support two notations for built-in filterreaders :

  <filterchain>
    <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
      <param type="token" name="DATE" value="${TODAY}"/>
    </filterreader>
  </filterchain>

and

  <filterchain>
    <replacetokens>
      <token key="DATE" value="${TODAY}"/>
    </replacetokens>
  </filterchain>

For third party filterreaders only the first notation is supported,
ofcourse.

If we decide to go for the filterchain implementation instead of the
fitlerset, I might some need help as I don't think I'll be having much time
(at least not enough, I think) in the next week or weeks ...

I certainly would like to avoid having to support both filtersets and
filterchains, like Ant is forced to do because of backward compatibility, so
we should decide on this as soon as possible ...

I'd definitely prefer going for the filterchain support, even if that means
that I've wasted my effort on the filterset implementation, but as I said, I
could use a hand ...

Gert


----- Original Message -----
From: "Mitch Denny" <[EMAIL PROTECTED]>
To: "Gert Driesen" <[EMAIL PROTECTED]>; "Ian MacLean"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 07, 2003 11:58 AM
Subject: RE: [nant-dev] [Fwd: Ready to tackle next release]


Cool, so should I bother with the replace task? One of the tasks modes
is NAnt and Regex (as well as simple text substitution). The begin and
end token attributes wouldn't make sense in that case and it would
(possibly) be better to do something like:

<filtersets>
<filterset>
<propertyfilter>
<propertyset>
<exclude
property="nant.project.basedir" />
</propertyset>
</propertyfilter>
</filterset>
</filtersets>

This means search on all ${...} tokens and replace them with the
matching property except the nant.project.basedir property.

----------------------------------------
- Mitch Denny
- [EMAIL PROTECTED]
- http://www.monash.net
- +61 (414) 610141
-

> -----Original Message-----
> From: Gert Driesen [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 07, 2003 3:22 PM
> To: Ian MacLean
> Cc: Mitch Denny; [EMAIL PROTECTED]
> Subject: Re: [nant-dev] [Fwd: Ready to tackle next release]
>
> I've just checked in filterset support for both the <copy>
> and <move> tasks. I still have to add some examples to the
> tasks though. ..
>
> You can now use the following build fragments :
>
> <copy todir="d:\test-copy" includeemptydirs="false" encoding="utf-8">
>     <fileset basedir="d:\cvs\nant\doc\help">
>         <includes name="*" />
>     </fileset>
>     <filtersets>
>         <filterset begintoken="@" endtoken="@">
>             <filter token="TEST" value="123" />
>         </filterset>
>         <filterset begintoken="#" endtoken="#">
>             <filter token="DUNNO" value="WHAT" />
>         </filterset>
>     </filtersets>
> </copy>
>
> <move todir="d:\test-copy" includeemptydirs="false" encoding="utf-8">
>     <fileset basedir="d:\cvs\nant\doc\help">
>         <includes name="*" />
>     </fileset>
>     <filtersets>
>         <filterset begintoken="@" endtoken="@">
>             <filter token="TEST" value="123" />
>         </filterset>
>         <filterset begintoken="#" endtoken="#">
>             <filter token="DUNNO" value="WHAT" />
>         </filterset>
>     </filtersets>
> </move>
>
> I haven't really tested it thoroughly, but it should work :-)
>
> Let me know if you encounter any issues ...
>
> Gert
>
> ----- Original Message -----
> From: "Ian MacLean" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> To: "Gert Driesen" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> Cc: "Mitch Denny" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >;
> <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> Sent: Monday, October 06, 2003 10:18 AM
> Subject: Re: [nant-dev] [Fwd: Ready to tackle next release]
>
>
> > Awesome. Good work Gert. This will be nice.
> >
> > Ian
> > Gert Driesen wrote:
> >
> > >I don't think we should rush a task in ...
> > >
> > >However, I agree that we shouldn't wait until support for
> filterchains is
> > >added.  But if we add such a task to NAnt core, we should
> at least support
> > >both filtersets and filesets ...
> > >
> > >I already "ported" the base classes for filtersets from Ant
> > >(NAnt.Core.Types.FilterSet(Collection) and
> > >NAnt.Core.Types.Filter(Collection)) ... these are
> available in cvs now ...
> > >so it shouldn't really be hard to add this to your replace
> task ... I'll
> > >look into adding support for filtersets to the copy and
> move tasks later
> > >(probable tomorrow or so)
> > >
> > >Gert
> > >
> > >----- Original Message -----
> > >From: "Ian MacLean" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> > >To: "Mitch Denny" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> > >Cc: "Gert Driesen" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >;
> > ><[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> > >Sent: Monday, October 06, 2003 4:25 AM
> > >Subject: Re: [nant-dev] [Fwd: Ready to tackle next release]
> > >
> > >
> > >
> > >
> > >>+1, mainly because I've just found a use for it in our
> linux build. We
> > >>need to create a nant shell script that contains the full
> path to the
> > >>just built NAnt.exe which we won't know till we build it.
> So it would be
> > >>a prime candidate for a use of the replace task.
> > >>
> > >>Ian
> > >>
> > >>
> > >>
> > >>>The <touch /> task could possibly be modified to do it.
> But replace
> > >>>would possibly be more intuitive for new users than
> using a filter
> > >>>chain. It could probably support filter chains anyway -
> it might also be
> > >>>cool to have a generic <filter /> task too. Next release :)
> > >>>
> > >>>I'm thinking that we could put the replace task in now
> since it would be
> > >>>useful, and then modify its implementation when chaining
> support is
> > >>>added.
> > >>>
> > >>>What do you all think?
> > >>>
> > >>>----------------------------------------
> > >>>- Mitch Denny
> > >>>- [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > >>>- http://www.monash.net <http://www.monash.net>
> > >>>- +61 (414) 610141
> > >>>-
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>>-----Original Message-----
> > >>>>From: Ian MacLean [mailto:[EMAIL PROTECTED]
> > >>>>Sent: Monday, October 06, 2003 2:03 AM
> > >>>>To: Gert Driesen
> > >>>>Cc: Mitch Denny; [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> > >>>>Subject: Re: [nant-dev] [Fwd: Ready to tackle next release]
> > >>>>
> > >>>>I just noticed that Ant still has both the replaceTask and
> > >>>>the filtersets in copy/zip etc. I'm sure you could accomplish
> > >>>>an in-place replace with filtersets but I can see a task
> > >>>>called replace being easier for new uesrs to deal with than
> > >>>>filterchains.
> > >>>>
> > >>>>Ian
> > >>>>
> > >>>>http://ant.apache.org/manual/CoreTasks/replace.html
> > >>>>
> > >>>>Gert Driesen wrote:
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>>to be honest, I'm not sure about that one ... If
> necessary we could
> > >>>>>ofcourse create a task for that, but I was just saying we don't
> > >>>>>necessary need one ... didn't really give it much
> thought yet ...
> > >>>>>
> > >>>>>Gert
> > >>>>>
> > >>>>>----- Original Message -----
> > >>>>>From: "Ian MacLean" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> > >>>>>To: "Gert Driesen" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> > >>>>>Cc: "Mitch Denny" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >;
> > >>>>><[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> > >>>>>Sent: Sunday, October 05, 2003 1:53 PM
> > >>>>>Subject: Re: [nant-dev] [Fwd: Ready to tackle next release]
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>>What if you want to replace strings in a file in place ? -
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>ie without
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>>>copying/moving the file
> > >>>>>>
> > >>>>>>Ian
> > >>>>>>Gert Driesen wrote:
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>>something like that yes :-)
> > >>>>>>>
> > >>>>>>>but instead of having a separate task for that
> purpose, filterchain
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>support
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>>>would be added to existing tasks (like copy, zip, ...)
> > >>>>>>>
> > >>>>>>>Gert
> > >>>>>>>
> > >>>>>>>----- Original Message -----
> > >>>>>>>From: "Mitch Denny" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> > >>>>>>>To: "Gert Driesen" <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >; "Ian MacLean"
> > >>>>>>><[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >
> > >>>>>>>Cc: <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> >
> > >>>>>>>Sent: Sunday, October 05, 2003 12:15 PM
> > >>>>>>>Subject: RE: [nant-dev] [Fwd: Ready to tackle next release]
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>So in implementation it would work like this:
> > >>>>>>>
> > >>>>>>>[FilterChain("filterchain")]
> > >>>>>>>public FilterChain FilterChain {
> > >>>>>>>...
> > >>>>>>>}
> > >>>>>>>
> > >>>>>>>Then in the execute task:
> > >>>>>>>
> > >>>>>>>StreamReader reader = new StreamReader(...);
> StreamWriter writer =
> > >>>>>>>new StreamWriter(...);
> this.FilterChain.Filter(reader, writer);
> > >>>>>>>
> > >>>>>>>Or something like that.
> > >>>>>>>
> > >>>>>>>----------------------------------------
> > >>>>>>>- Mitch Denny
> > >>>>>>>- [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > >>>>>>>- http://www.monash.net <http://www.monash.net>
> > >>>>>>>- +61 (414) 610141
> > >>>>>>>-
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>
> > >>
> > >>
> > >>-------------------------------------------------------
> > >>This sf.net email is sponsored by:ThinkGeek
> > >>Welcome to geek heaven.
> > >>http://thinkgeek.com/sf
> > >>_______________________________________________
> > >>nant-developers mailing list
> > >>[EMAIL PROTECTED]
> > >>https://lists.sourceforge.net/lists/listinfo/nant-developers
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> > >
> > >-------------------------------------------------------
> > >This sf.net email is sponsored by:ThinkGeek
> > >Welcome to geek heaven.
> > >http://thinkgeek.com/sf
> > >_______________________________________________
> > >nant-developers mailing list
> > >[EMAIL PROTECTED]
> > >https://lists.sourceforge.net/lists/listinfo/nant-developers
> > >
> > >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf <http://thinkgeek.com/sf>
> > _______________________________________________
> > nant-developers mailing list
> > [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> >
> https://lists.sourceforge.net/lists/listinfo/nant-developers
> <https://lists.sourceforge.net/lists/listinfo/nant-developers>
> >
> >
>




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to