ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Custom Path/FileSet types
Date Tue, 03 Jun 2003 14:41:16 GMT
you probably should get the book "Java Development with Ant"  isbn
1-930110-58-8.  Allot of this is covered in the book.

I am reading the book and I have seen allot of future chapters that cover
what you are asking.  I unfortunate have not done what you are asking so I
can't answer your questions.
Mark Russell
PNC Financial Services Group

Tuesday, June 03, 2003 10:27 AM
To: <>
From: "Adam Jack" <>
Subject: Custom Path/FileSet types

I have a custom task that is currently implemented to generate
named/referencable Path & FileSet elements as it's output. The "user" of
task is expected to know the refid's of the constructs this task creates.
This works, but seems a bit tad convoluted. The idea has arisen to re-work
this task as Path and/or FileSets.

[Basically the task (or soon to be type) takes a "project name" as input,
and downloads/returns the latest list of JARs for that project. The user
might wish to compile against those JARs, or copy them to a distribution,

Looking at the ant source code FileSet (with AbstractFileSet) seems quite
doable [clearly it is already subclassed], and Path.PathElement appear
either simpler, or figureoutable. That said, I don't know the concepts
behind "custom types" and
doesn't seem to have guidance for types.

Some questions:

1) Does what I am doing make sense as types verses tasks? What are the pros
and cons of each?
2) Can one construct a Path from a FileSet? [Meaning, do I need to write
code for both, or ought
I suspect I need a singleton factory to create my types,
3) I suspect I'll have a singleton factory (of sorts) to create my
constructs. That entity will probably want some per VM or per project
configuration (or perhaps not a real singleton). I see I can access the
project, so  I can access properties, but are there helpers for per project
instances? Do I need to roll my own?
4) How ought I handle logging? Can types log? Logging seems attached to the
Task, not ProjectComponent. If not, how might user tasks report debugging
information for types?
5) If I create a custom FileSet (say) can I add it to anything that takes a
FileSet (because I am a sub-class) or does the "container" need to
understand the XML tag? I.e. can I add <mypathelement to <classpath?

Some deeper ones (which I might just have to figure out from the code,
unless somebody is feeling overly generous w/ insight):

1) How do I figure out what introspection can do for me, in terms of
constructors? Looking at ZipFileSet I see a bunch of constructors, but I
don't really know how they map to the XML users can provide.
2) How do I get inside FileSet and AbstractFileSet? How can I determine
methods I must provide, and what ones I can call? How do I select between
the two?
3) I see a bunch of helper methods that are getX(Project p) where a
ProjectComponent resolves answers based on itself within a project.
4) If I don't want PatternSets, do I need FileList not FileSet? Does this
limit what users can pass this to? Why do these two exist, what is the
reason for them not being able to be the same thing?

Thanks in advance for you assistance.


Experience Sybase Technology ...

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message