ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Purkayastha, Siddhartha" <>
Subject RE: Command Line Debugging
Date Tue, 07 Jun 2011 09:40:00 GMT
Hello -
In case you have not had an occassion to go through the original mail, the idea is to build
a command line utility that will allow the user to pause the build execution (similar to a
break-point), and allow the user to inspect the status of the build. For example, what is
the value of a property, what is the value of a path, where do I find the declaration of a
property a.b.c. 
The sources for the POC may be found at this location:
The patch sub-directory has a patch of the implementation.
You could try this on the Ant build.xml itself. Something like this:
    ant -breakAt dist-lite
The build pauses and presents a prompt to the end user asking for a command to run. Here are
somethings you could try:
    locate property Should give you the declaration of the property inside
the build file
    inspect property Should give you the current value of the property
    inspect path some.path: Should give you the current value of the path
    return: Returns from the prompt and resumes the build
Here is a sample output from a run of my local setup:
      [jar] Building jar: D:\sandboxes\ant-svn\build\lib\ant-testutil.jar
-------- Ant Command Line Debugger --------
 [Debugger] DEBUGGER>
locate property Name
Detected a property by name [Name]. Build file value: Apache Ant
Located at: D:\sandboxes\ant-svn\build.xml:33:
 [Debugger] DEBUGGER>
inspect property tests-classpath
Found no such property.
 [Debugger] DEBUGGER>
inspect path tests-classpath
[pathconvert] D:\sandboxes\ant-svn\build\classes
[pathconvert]     - D:\sandboxes\ant-svn\lib\optional\ant-antunit-1.1.jar
[pathconvert]     - D:\sandboxes\ant-svn\lib\optional\junit-3.8.2.jar
[pathconvert]     - D:\sandboxes\ant-svn\lib\optional\junit-4.8.1.jar
 [Debugger] DEBUGGER>
--------- Resuming Ant Execution ----------
What do you think about the utility of such a tool?


From: Jean-Louis Boudart []
Sent: Mon 6/6/2011 9:09 PM
To:; Ant Developers List
Subject: Re: Command Line Debugging

The idea really looks like promising.

I think this feature could have a better place in ant itself (i'm adding
them in copy of this email).
Could you share the code of your POC somewhere with some guide line to test
it?  I'm  pretty sure people will have ideas when they will try it. If you
need a place to publish it you can use this :

2011/5/29 Purkayastha, Siddhartha <>

> Hello All -
> I wanted to discuss an idea with you about diagnostics. When considering
> about diagnostics, it should comprise of a set of tools that can help me
> diagnose issues I am facing with my build. Ant -diagnostics returns lots of
> variables that can be valuable to resolving environment / setup issues.
> I am thinking of the possibility of a Command Line Debugger / Inspector
> included within EasyAnt (or may be even Ant itself). I am not aware if such
> a tool already exists.
> It could behave something like this:
> I can run:
>             ant -breakAt=someTarget
> The breakAt parameter could indicate a breakpoint at target 'someTarget'.
> The user could be interactively displayed a prompt here:
>        breakpoint:
>         [Debugger] DEBUGGER>
> Where the user could issue a set of commands to inspect the state of the
> build so far.
> For example:
>         breakpoint:
>                 [Debugger] DEBUGGER> inspect
>                Property Value: HelloWorld
> The same idea could be extended to include other build factors, like paths,
> imported plugins etc. It may actually be extended to become a fully featured
> command line debugger, from where one can also set new property values or
> override existing values (probably a relaxation of immutability for the
> support of this tool) etc, do step over, step into etc.
> I did some experiments with this concept, I was able to break at a certain
> target and inspect values of properties that user wants to see, using a new
> target created at Runtime, with a single task that accepted user inputs from
> command line, interpreted it and displayed an output - And kept on doing so
> till the user typed 'return' on the prompt. I also think, as an extension -
> if we can also track audit history of different properties, paths,
> references etc, then this could be an effective tool. However, I do not
> think it is easily achievable today.
> I am wondering about the technical feasibility and utility of such an
> inbuilt tool. Can you share your thoughts on this?
> Thanks,
> Siddhartha

Jean Louis Boudart
Independent consultant
Project Lead <> 

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