customCallBack.xml script. Inside this script you had to call out to a special groovy.jdtcompile ant task, using a magic set of classpath references. When this approach worked, it did so by first compiling your Java code (with errors of course since your groovy code is not touched), and then re-compiling all your code using the joint compiler provided by Groovy-Eclipse.Not so pretty. It works for Groovy-Eclipse, but that is only because I know exactly what its limitations are and how to work around them.
A short while ago, I wrote about how we re-implemented PDE build for projects that use the AspectJ compiler. I've recently done the same for plugin projects that use Groovy.
Here's how it works:
- Install the latest dev snapshot of Groovy-Eclipse for Helios (you can write plugins that target Galileo (Eclipse 3.5), but you must use the Helios PDE builder to create the plugins).
- For each of your plugin projects, add the following to your
build.propertiesfile:
sourceFileExtensions=*.java, *.groovy compilerAdapter=org.codehaus.groovy.eclipse.ant.GroovyCompilerAdapter compilerAdapter.useLog=true # this ensures that exceptions are logged to the proper log file.
- Now you can run your PDE export (either headless or from within a running Eclipse using one of the Export wizards).
The only caveat is that each plugin project must contain at least one
.java file or else the PDE builder will ignore that plugin. The problem is described in Bug 318951. Before this can be addressed, I need a patch committed to the javac task, described here: Apache Bug 48829 (please vote the bug up if you want to see this fixed!).With that, creating Groovy-based Eclipse plugins now requires much, much less black magic.