Debugging Ant Scripts


If you need to troubleshoot an Ant script, or you just would like a tool to help you make sense of a working script, you can use the IDE's Ant Debugger module. The module essentially plugs into the IDE's visual debugging framework, provides most of the debugging features you are used to for Java files, and applies those features to Ant scripts. For example, you can

  • Use the Step Into, Step Over, Step Out, and Continue commands to trace execution of the script or a specific target. This feature is particularly useful to help you untangle the order in which nested targets (and even nested scripts) are called.

  • Use the Call Stack window to monitor the current hierarchy of nested calls.

  • Set breakpoints.

  • View the values of properties in the Local Variables window.

  • Set a watch on a property.

Figure 16-1. Ant Debugger


To start debugging a build script:

  1. Open the Files window and navigate to the build script.

  2. Right-click the build script, and choose Debug Target and then the name of the target you want to debug.

The program counter goes to the line where the target is declared and stops. Then you can step through the target with any of the normal debugging commands.



NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net