ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: [DISC] core extensions
Date Tue, 27 Mar 2001 13:03:46 GMT
At 02:47  27/3/01 +0200, Stefan Bodewig wrote:
>>   or enhance antcall to work with current list of executed targets
>
>This is to avoid running targets twice, right? I've no good idea how
>to solve this ATM.

I was thinking that we could use frANTics approach. We store a task "stack"
(ie a Vector with names of every task executed so far). When we go to the
next "lower" context (say via an antcall) we clone the stack and continue
using this stack (This could of course be optional). When we climb back
into last context (ie antcall finishes) the original is still in pristine
condition.

gah - thats not very clear but do you get the picture? I was thinking about
doing this for ant1.x task via a new attribute but have been too lazy to do
it ;)

>> * define task contexts that define various common aspects (logging,
>>   failure handling ...) and assign them to tasks.
>
>Need more input - on the "and assign" part.

I was thinking something as simple as the following for logging.

interface Task
{
 void setTaskContext( TaskContext context );
{

class MyTask
{
  TaskContext context;

  void setTaskContext( TaskContext context )
  {
    this.context = context;
  }

  Logger getLogger()
  {
    return context.getLogger();
  }

  public void run()
  {
    getLogger().debug( "Task is running!!!" );
  }
}


For other passive aspects (ie behaviour on failonerror, classloader task
runs with, verbosity of logging) is all dealt with in the engine.

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Mime
View raw message