You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Costin Manolache <cm...@yahoo.com> on 2002/11/26 21:24:25 UTC

RE: [PATCH] User defined types and tasks to be loaded before defa ult ones are...

Dominique Devienne wrote:

> I don't understand why you need to load custom tasks/types before the Core
> tasks/types. The current mechanism for loading them seems OK to me
> (awaiting <antlib> for a better mechanism though).

I don't know about his use case - for me it's saving the 4 seconds on 
startup and avoiding a lot of ugly code dealing with reloading
optional tasks in a different loader.

I use some code that allows adding junit.jar ( or other dependencies )
inside build.xml ( instead of ant.home/lib ), and this works by reloading
junit and similar tasks with a different loader. Lazy loading would 
avoid this.

In general, there is no reason to not allow the core tasks to be 
redefined. 



> I personally believe we need a mechanism to load and configure other types
> of Ant extension points (Mappers, Conditions, Selectors, Filters,
> XmlCatalog resolvers, and even custom extension points) similarly to
> what's currently possible for tasks/types, which is good enough for now.

I think we do have one already :-)

Any task can call methods in Project and core and add whatever hooks it
wants. 

For example in order to plug a particular antlib impl or a PropertyHelper
you just have a regular task that calls the add method.

It is easy to add "magic" - i.e. if a task implement one of the hooks
interfaces we can add it automatically, but it's more flexible and
clean to let the task control that ( apache2 modules follow the same
model, there is a single "module" that can add itself to any hook ).


> By that I mean ways to configure the custom class using complex Ant
> objects represented as nested XML elements, share classloader, and have
> access to the Project reference.

I think we're on the same page. 

Costin




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] User defined types and tasks to be loaded before defa ult ones are...

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 27 Nov 2002, Conor MacNeill <co...@cortexebusiness.com.au>
wrote:

> Not in a fully general way.

Try your example with Ant 1.5.1 (or the HEAD of the 1.5 branch) and it
will work.  This is one of the subtle backwards incompatibilities HEAD
has introduced by delaying <taskdef>'s execution.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] User defined types and tasks to be loaded before defa ult ones are...

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Stefan Bodewig wrote:
> On Tue, 26 Nov 2002, Costin Manolache <cm...@yahoo.com> wrote:
> 
> 
>>In general, there is no reason to not allow the core tasks to be 
>>redefined. 
> 
> 
> There isn't any reason - and it is possible right now.
> 

Not in a fully general way.

<project name="example" default="test">
   <taskdef name="echo" classname="org.apache.tools.ant.taskdefs.Jar"/>

   <target name="test">
     <!-- works -->
     <echo jarfile="test.jar">
     </echo>
     <!-- works -->
     <jar jarfile="test2.jar">
       <manifest>
       </manifest>
     </jar>
     <!-- doesn't work -->
     <echo jarfile="test3.jar">
       <manifest>
       </manifest>
     </echo>
   </target>
</project>

Conor


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] User defined types and tasks to be loaded before defa ult ones are...

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 26 Nov 2002, Costin Manolache <cm...@yahoo.com> wrote:

> In general, there is no reason to not allow the core tasks to be 
> redefined. 

There isn't any reason - and it is possible right now.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>