ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <jalbe...@cellectivity.com>
Subject RE: Using Ant API to retrieve task/target information
Date Tue, 01 Jun 2004 09:50:33 GMT
> From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
> 
> I think these getters arent there because we havent needed it 
> :-) Only the target class itself uses these information so 
> why putting them in? But if there is a need for having 
> getters outside I donĀ“t see an obstacle while adding them ... 
> the information are not unofficial ...
> 

Notice that you really cannot rely on the tasks allowing you to peek
at the information inside them. Remember that in principle ANT is a component
framework and that more and more we spect ANT components to be provided
by third parties. So you cannot count on having getters for avery component.

With that in mind, I would suggest taking a look at ProjectHelper and
the UnknownObject infrastructure. Maybe a version of ProjectHelper can be
provided that does not resolve things to actual targets and tasks
but give you UnknownObjects instances that you can peek into.

Another alternative is to write a ProjectHelper2DOM/JDOM version that gives
you the tree and then you go from there. There are issues though like 
what to do about imports (they will not be resolved unless you 
actually execute the project).

Jose Alberto


> Do you need more?
> 
> 
> Jan
> 
> 
> > -----Original Message-----
> > From: Christophe Labouisse [mailto:ant-ml@ggtools.net]
> > Sent: Tuesday, June 01, 2004 10:59 AM
> > To: dev@ant.apache.org
> > Subject: Using Ant API to retrieve task/target information
> > 
> > 
> > Hi,
> > 
> > I'm the writer of the Grand tool
> > (http://www.ggtools.net/grand) and since
> > I came upon some issues with the Ant API I'd like to have 
> some more or
> > less "official" advice about the way I use it.
> > 
> > I started Grand shortly after Ant 1.6.0 was released since the 
> > visualization tools I used where all broken. I find out 
> that the Ant 
> > API was providing all I need to do a basic dependency graph and
> > will allow me
> > not to duplicate "things" already done by ant such as XML parsing,
> > importing targets, etc. Beside using the API allow to display 
> > dynamically
> > created targets. Soon I needed to handle calls such as the 
> > one created by
> > ant or antcall. This was a little bit more complicated and I 
> > have to use
> > the RuntimeConfigurable to get enough information.
> > 
> > Currently I'd like to display in the graph some information on 
> > conditionnal targets (with a if or unless attribute). The 
> information 
> > is here since the target class has ifCondition and
> > unlessCondition attributes
> > but I cannot get it since the are no getter for them.
> > 
> > So I'm wondering if using the Ant API as I do to peek into a
> > project is
> > something which is ok albeit the API is currently lacking a 
> > few things or
> > the API should not be used the way I do?
> > 
> > Cheers
> > 
> > Christophe
> > 
> > --
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail: dev-help@ant.apache.org
> > 
> 

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


Mime
View raw message