AntResolver Significance - In Custom Tasks

View: New views
2 Messages — Rating Filter:   Alert me  

AntResolver Significance - In Custom Tasks

by Raja Nagendra Kumar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

What is the significance of AntResolver when compared to directly creating Ant() task.

Basically, I am looking to write a pure java class, which intern invokes ant and its script. In such scenario how does ant()  behaves.

In this approach of creating Ant() would not have any owner task and getProject() should return project of the build file it is pointing to.

Would such usage of Ant class work fine.

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com

Re: AntResolver Significance - In Custom Tasks

by Stefan Bodewig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2009-11-06, Raja Nagendra Kumar <Nagendra.Raja@...> wrote:

> What is the significance of AntResolver when compared to directly creating
> Ant() task.

Are you talking about
org.apache.tools.ant.taskdefs.optional.extension.resolvers.AbtResolver?
This class doesn't have any significance beyond the jarlib-resolve task
and is not related to the Ant task at all.

> In this approach of creating Ant() would not have any owner task and
> getProject() should return project of the build file it is pointing to.

This would violate Ant's contracts - which may be fine for your own
class.  getProject is guaranteed to return the Project instance a task
is part of.

The existing getNewProject method on the Ant task should give you the
desired information.

Stefan

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