Debugging DSLD Scripts
Not too long ago, I introduced DSL descriptors (DSLDs) for Groovy-Eclipse. DSLDs are Groovy scripts that provide rich editing support (content assist, navigation, etc.) for Groovy projects in your Eclipse workspace. Since DSLDs can only be executed inside a running Eclipse process, debugging is not as simple as firing up the Eclipse debugger and stepping through a Groovy script. In this post, I'll describe some simple and some more complex techniques that you can use for debugging your DSLDs.
To get all of this working, you will need the latest development builds:
- Groovy-Eclipse: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.7/
- STS Grails Tooling (optional, for debug evaluations): http://dist.springsource.com/snapshot/TOOLS/nightly/e3.7
- AJDT (optional, for debug evaluations): http://download.eclipse.org/tools/ajdt/37/update
Simple and crude
The simplest and crudest way to debug your DSLDs is by using println
. This will print expressions to the standard out of the running Eclipse process, which can be seen if you launched your Eclipse from the command line. However, I recommend using a log
statement instead. This will print logging information to the Groovy event console…