ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wolfgang Häfelinger <whaefelin...@epo.org>
Subject tracing macros?
Date Tue, 20 Feb 2007 17:20:28 GMT
Hey,

I'm  using  macrodef  a lot (a really great feature). What I'm looking for 
is a simple
way of tracing which macro is invoked. Something like "entring macro .. ", 
"leaving
macro ..".

So derived a Trace class from org.apache.tools.ant.taskdefs.Sequential, 
some-
thing like:

public class Trace extends Sequential {
  public void execute() 
  {
     // entrer trace statements ..
     super.execute();
     // leaving trace statements ..
  }
}

Then I created a task name "trace" and tried something like

<macrodef name="test">
  <trace>
     <!-- do something -->
  </trace>
</macrodef>

which unfortunatley does NOT work :-( because Macrodef has a 
createSequential() 
method while "lacking" a addSequential(Sequential s)  method.

Wouldn't it be cool to implementent such a trace task? Or do I miss 
something?
Perhaps Ant (1.7) allows already tracing of macros ???

It would be even cooler  if  my  trace task could figure out automatically 
that the 
name of its surrounding  macrodef is "test". Is there a way to do that?? 

Yes, I   k n o w  that I can put my trace task within the macrodef 
sequential. This
works but it has some disadvantages:
 - performance
 - code bloat (would like to keeps things short and simple)
 
Regards,
Wolfgang.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message