ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: AW: how to access/iterate id in <script>
Date Thu, 04 Jan 2007 10:16:20 GMT
On 1/4/07, paul.arzul@sadalbari.com <paul.arzul@sadalbari.com> wrote:
> Quoting Peter Reilly <peter.kitt.reilly@gmail.com>:
>
> > On 1/4/07, paul.arzul@sadalbari.com <paul.arzul@sadalbari.com> wrote:
> > > Quoting Jan.Materne@rzf.fin-nrw.de:
> > >
> > > > project.getProperty("source.dirs");
> > >
> > > source.dirs is an id, not a property. i assume the distinction is
> > important,
> > > since getProperty returns null (which is correct but unhelpful).
> > You need to use project.getReference("source.dirs"),
> > however you need to do more things as "source.dirs" is a DirSet which
> > extends
> > AbstractFileSet. - see the <script> manual page for an example.
> > The following may work (not tested).
> >      var fs = project.getReference("source.dirs");
> >       // Get the  (array) of that fileset
> >       ds = fs.getDirectoryScanner(project);
> >       srcDirs = ds.getIncludedDirectories();
>
> thanks for that.
>
> this is confusing me. a <dirset dir="foo" id="bar"> should have done the
> work scanning the directory already, yes? so why do we need to do it again in
> the script? is this some sort of lazy evaluation? i was hoping to pass the
> results through.
1)
The contents of the dirset may change after the reference
declaration. - for example as a result of ant tasks.

2)
The java api of some types in ant were not really designed for ease of use.

Peter

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

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


Mime
View raw message