[GRADLE-1124] When the groovy plugin is applied to a project which uses groovy only for testing, the project ends up with groovy as an unnecessary runtime dependency Created: 17/Aug/10  Updated: 15/Jan/13  Resolved: 07/Jan/13

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: 1.4-rc-1

Type: Bug
Reporter: Adam Murdoch Assignee: Unassigned
Resolution: Fixed Votes: 7


 Description   

Say I have a project which uses Groovy for testing only. At the moment, however, if I apply the 'groovy' plugin, I end up with groovy as a runtime dependency, rather than just a test dependency. Also, I end up with a bunch of tasks (compileGroovy, groovydoc) which don't do anything. Same applies for the 'scala' plugin.

It would be nice to have some way to apply a language plugin on a per-source set basis.



 Comments   
Comment by Adam Murdoch [ 17/Aug/10 ]

A workaround is to move the groovy configuration to testCompile:

configurations { 
    compile.extendsFrom = []
    testCompile.extendsFrom groovy
}
Comment by Steve Appling [ 19/Aug/10 ]

I found that the above broke my compile because it took out the providedCompile configuration. The following works a little better:

configurations {
    compile.extendsFrom = [providedCompile]
    testCompile.extendsFrom groovy
}

This is fragile, however, and we really do need built in support. Perhaps a groovyTest configuration?

Generated at Wed Jun 30 11:47:31 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.