If you have the jUnit and Spock test suite in the test suite (for example, we do), you can use the groovyc co-compilation function, something like this:
<groovyc srcdir="${testSrcDir}" destdir="${testTarget}" classpathref="testCompileClasspath"> <javac deprecation="on" debug="on"/> </groovyc>
This will automatically compile Java and Groovy tests. From now on, you can run tests as before using the junit task.
Jeff olson
source share