You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Knuplesch, Jürgen <Ju...@icongmbh.de> on 2007/10/11 14:06:04 UTC

Fileset Evaluation

If I define a fileset via a patternset and a id like that:

    <patternset id="dopecopy.configpattern.kunde">
      <exclude name="javahelp/**"/>
      <exclude name="imagesText/**"/>
      <exclude name="dcpcall.xml"/>
      <exclude name="mffafp.pro"/>
    </patternset>
    
    <fileset id="dopecopy.configfiles.kunde" dir="${dope.configdir.kunde}">
      <patternset refid="dopecopy.configpattern.kunde"></patternset>
    </fileset>

And now I add another file to the fileset-dir: ${dope.configdir.kunde}
E.g. like that:

      <jar destfile="${dope.configdir.kunde}/editorHelp.jar">
          <fileset dir="${dope.configdir.kunde}/javahelp/editor" />
      </jar>


Will editorHelp.jar be copied or not?
    
    <copy todir="${dope.target.dir}/config">
      <fileset refid="dopecopy.configfiles.kunde" />
    </copy>

Is editorHelp.jar part of the fileset, even if it did not exist, when I created the fileset?
Why?
In my case, I think it was part of the fileset and I don't understand why!

In other words:
When will filesets be evaluated? Waht are the rules?



-- 
Jürgen Knuplesch                    www.icongmbh.de
icon Systemhaus GmbH                Tel. +49 711 806098-275
Sophienstraße 40                    
D-70178 Stuttgart                   Fax. +49 711 806098-299

Geschäftsführer: Uwe Seltmann
HRB Stuttgart 17655
USt-IdNr.: DE 811944121 

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


Re: Fileset Evaluation

Posted by Matt Benson <gu...@yahoo.com>.
--- Steve Loughran <st...@apache.org> wrote:

> Knuplesch wrote:
> > If I define a fileset via a patternset and a id
> like that:
> > 
> >     <patternset id="dopecopy.configpattern.kunde">
> >       <exclude name="javahelp/**"/>
> >       <exclude name="imagesText/**"/>
> >       <exclude name="dcpcall.xml"/>
> >       <exclude name="mffafp.pro"/>
> >     </patternset>
> >     
> >     <fileset id="dopecopy.configfiles.kunde"
> dir="${dope.configdir.kunde}">
> >       <patternset
> refid="dopecopy.configpattern.kunde"></patternset>
> >     </fileset>
> > 
> > And now I add another file to the fileset-dir:
> ${dope.configdir.kunde}
> > E.g. like that:
> > 
> >       <jar
> destfile="${dope.configdir.kunde}/editorHelp.jar">
> >           <fileset
> dir="${dope.configdir.kunde}/javahelp/editor" />
> >       </jar>
> > 
> > 
> > Will editorHelp.jar be copied or not?
> >     
> >     <copy todir="${dope.target.dir}/config">
> >       <fileset refid="dopecopy.configfiles.kunde"
> />
> >     </copy>
> > 
> > Is editorHelp.jar part of the fileset, even if it
> did not exist, when I created the fileset?
> > Why?
> > In my case, I think it was part of the fileset and
> I don't understand why!
> > 
> > In other words:
> > When will filesets be evaluated? Waht are the
> rules?
> 
> They're generally evaluated the first time theyre a
> used, and (probably) 
> not re-evaluated.
> 

Actually IIRC FileSet and DirSet are (by virtue of
their common parent class) implemented such that each
use re-scans the filesystem, except in the rare event
that the DirectoryScanner is requested concurrently
from separate threads.  It would probably be pretty
easy to concoct a "frozen" ResourceCollection, but as
a workaround wrapping the fileset in a <union> and
forcing an evaluation with e.g. <pathconvert> or
<resourcecount>, then relying on its cache=true
default setting to cache those results...

-Matt

> to get reevaluation in, dont cache the fileset but
> explicitly redeclare 
> it again.
> 
> -- 
> Steve Loughran                 
> http://www.1060.org/blogxter/publish/5
> Author: Ant in Action           http://antbook.org/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



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


Re: Fileset Evaluation

Posted by Steve Loughran <st...@apache.org>.
Knuplesch wrote:
> If I define a fileset via a patternset and a id like that:
> 
>     <patternset id="dopecopy.configpattern.kunde">
>       <exclude name="javahelp/**"/>
>       <exclude name="imagesText/**"/>
>       <exclude name="dcpcall.xml"/>
>       <exclude name="mffafp.pro"/>
>     </patternset>
>     
>     <fileset id="dopecopy.configfiles.kunde" dir="${dope.configdir.kunde}">
>       <patternset refid="dopecopy.configpattern.kunde"></patternset>
>     </fileset>
> 
> And now I add another file to the fileset-dir: ${dope.configdir.kunde}
> E.g. like that:
> 
>       <jar destfile="${dope.configdir.kunde}/editorHelp.jar">
>           <fileset dir="${dope.configdir.kunde}/javahelp/editor" />
>       </jar>
> 
> 
> Will editorHelp.jar be copied or not?
>     
>     <copy todir="${dope.target.dir}/config">
>       <fileset refid="dopecopy.configfiles.kunde" />
>     </copy>
> 
> Is editorHelp.jar part of the fileset, even if it did not exist, when I created the fileset?
> Why?
> In my case, I think it was part of the fileset and I don't understand why!
> 
> In other words:
> When will filesets be evaluated? Waht are the rules?

They're generally evaluated the first time theyre a used, and (probably) 
not re-evaluated.

to get reevaluation in, dont cache the fileset but explicitly redeclare 
it again.

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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