GroovyCompile testCompile = (GroovyCompile) javaPlugin.configureTestCompile(
(Compile) project.createTask(GUtil.map("type", GroovyCompile.class, "overwrite", true), TEST_COMPILE),
(Compile) project.task(COMPILE),
DefaultConventionsToPropertiesMapping.TEST_COMPILE,
project.getConfigurations());
<BUG>testCompile.setGroovyClasspath(project.getConfigurations().get("groovy"));
testCompile.conventionMapping(GUtil.map(</BUG>
"groovySourceDirs", new ConventionValue() {
public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
return groovy(convention).getGroovyTestSrcDirs();

GroovyCompile testCompile = (GroovyCompile) javaPlugin.configureTestCompile(
(Compile) project.createTask(GUtil.map("type", GroovyCompile.class, "overwrite", true), TEST_COMPILE),
(Compile) project.task(COMPILE),
DefaultConventionsToPropertiesMapping.TEST_COMPILE,
project.getConfigurations());
testCompile.setGroovyClasspath(project.getConfigurations().get("groovy"));
testCompile.setDescription("Compiles the Java and Groovy test source code.");
testCompile.conventionMapping(GUtil.map(
"groovySourceDirs", new ConventionValue() {
public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
return groovy(convention).getGroovyTestSrcDirs();
