ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <>
Subject Re: Custom Path/FileSet types
Date Wed, 04 Jun 2003 10:15:52 GMT
On Tuesday 03 June 2003 18:37, Adam Jack wrote:
> pros
> 	> and cons of each?
> 	It depends....,  It may be usefull to be both. In your case it looks like
> 	it should be a datatype.
> If I go down to DataType, aren't I cutting myself off from this being
> passed into existing tasks?

Currently yes. 

> 	> 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?
> 	You should not use a singleton factory. A number of <typedefs/> should
> 	be enough.
> Not sure I follow that, but then I probably mis-explained my intentions (or
> just plain used the wrong word). Making an analogy --- I see the things I
> create as 'File Handles', and I need to create a 'File Sub-System' to
> create them (and that is heavier weight.) I need to configure that once
> (knowledge of remote repositories, etc) and then these "file references"
> can be found/downloaded/reference much easier. That clearer? Any concept
> like that exist?

I am not sure I follow. Ant uses references (id="x") to store bits of
information to be used later, maybe you could use that.

> 	> 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?
> 	A project componet has a setProject(Project) method that gets called when
> ant
> 	creates the object. Use project#log() for logging.
> Doh, didn't see logging down there.
> 	> 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?
> 	There is work ongoing that will allow you to do this. In fact in the
> current
> 	nightly build there is initial support for adding custom paths to the
> path.
> I am game for nightly, can you elaborate?

With the nightly one can do the following:

  <typedef name="mypath" classname="acme.MyPath"/>
  <path id="id.path">
    <mypath path="build.xml"/>

for some more details ;-)


View raw message