You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Phillip Lord <p....@russet.org.uk> on 2002/12/16 16:16:10 UTC

tracing source code in generated build.xml



I have a quick question. 

I'm in the middle of developing a small tool that generates out ant
project files. (If you are interested its at
http://www.russet.org.uk/download/java/antmerge/). One of the problems
with this approach is that the error tracing that I get relates to the
build.xml file, rather than the source file that this is actually
generated from. 

I was wondering, is there any way to embed source file information
into an ant build.xml, so that this gets reported instead? 

If not, I can think of some ways that this could be added:- essentially
you want to tag something like <source file="in.xml" line="44"/> that
can be placed legally in as many different places as possible. Then
the code which generates the build.xml could sprinkle these liberally
through the generated build.xml. And then ant would need to be fiddled
with, to get the correct error reporting (based on the last source tag
that it had read). 

Does this sound feasible? Would anyone like to hazard a guess as to
how hard it would be. 

Cheers

Phil

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


Re: tracing source code in generated build.xml

Posted by Phillip Lord <p....@russet.org.uk>.
>>>>> "Conor" == Conor MacNeill <co...@cortexebusiness.com.au> writes:


  Conor> What you could try would be to develop your custom <source>
  Conor> task to spit out the information to the log and then combine
  Conor> this with a custom build listener to fiddle with error
  Conor> messages as they come out.


  >> Does this sound feasible? Would anyone like to hazard a guess as
  >> to

  >> how hard it would be.


  Conor> Could be hard enough but you'll learn heaps :-)

 
Okay. I guess this will have to go on the backburner, as its not
critical for me, but at least I know that its a reasonable way to do
it!

Cheers

Phil

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


Re: tracing source code in generated build.xml

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Phillip Lord wrote:
> 
> 
> I was wondering, is there any way to embed source file information
> into an ant build.xml, so that this gets reported instead? 

No, there is no way to do this that I know of.

> 
> If not, I can think of some ways that this could be added:- essentially
> you want to tag something like <source file="in.xml" line="44"/> that
> can be placed legally in as many different places as possible. Then
> the code which generates the build.xml could sprinkle these liberally
> through the generated build.xml. And then ant would need to be fiddled
> with, to get the correct error reporting (based on the last source tag
> that it had read). 

What you could try would be to develop your custom <source> task to spit out 
the information to the log and then combine this with a custom build 
listener to fiddle with error messages as they come out.

> 
> Does this sound feasible? Would anyone like to hazard a guess as to
> how hard it would be. 

Could be hard enough but you'll learn heaps :-)

Conor



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