ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: Re[2]: Why are there paths and filesets?
Date Tue, 18 Dec 2001 13:28:01 GMT
> EH> A path is an ordered list of files or directories.
>
> EH> A fileset is a rooted, from a single directory, collection (order
> EH> unspecified) of files.
>
>   So the difference between path and fileset is that the first is
> ordered and the latter is unordered?

Thats not the only difference.  Paths don't have to have their components
exist when defined.  Filesets resolve the files when defined.  I'm sure
others will chime in if I misspeak this stuff.  Paths can contain
directories.  Filesets do not.

> EH> You can define a fileset and give it an id, and re-use it inside a
defined
> EH> path:
>
> EH> <fileset dir="some/directory" id="my.files"/>
>
> EH> <path id="my.path">
> EH>   <fileset refid="my.files"/>
> EH> </path>
>
>   Yes... thank you.. I didn't see that possiblity...
> But, is there a way to re-use a path inside a fileset?

Remember that a path is not necessarily from a particular root, whereas a
fileset is.  So no, it doesn't make sense to have a path inside a fileset,
only patternsets.

Perhaps if you give us something more concrete to work with besides path and
fileset abstractions we can work out ways to accomplish what you're after.

>   I think using a fileset inside a path is a bad way, because the
> special quality of a path, perserving the order, is lost by defining a
> path using a fileset.

Personally, I don't really define paths with nested filesets.  I want more
control over what is in a path than just blindly picking up everything from
a fileset.

>   Using it vice versa, that is define a fileset using a path, doesn't
> have this disadvantage. BTW, in my example, defining path and fileset
> using a property, the order information is not lost in the path.

Maybe you're after patternsets rather than paths.  The Ant manual has some
decent help on these concepts with loads of examples.

> EH> So, no need to define anything twice and we'd all be complaining more
if
> EH> this reusability was not available!  :)
>
>   I will agree if there's a way to define a fileset using a path.

Again, that doesn't make sense given that a fileset is rooted from a
particular directory.

Give a more concrete example of whats causing you trouble and I'm sure the
ant-user community can help work out what you're after.

    Erik



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


Mime
View raw message