Thanks for all the suggestions.  I thought I would update the list with what I 
found out.
Jason Porter wrote:
> Exclude it for runtime?

I had tried 
configurations {
  runtime.exclude     group:'org.codehaus.groovy'
}

but this ends up excluding it from testRuntime as well since testRuntime 
extends runtime.  If I do this, then my I can't use it for testing.  There 
might be some other trick here that I didn't find, but I didn't figure out a 
solution this way.

Jim Moore wrote:
> Another hack is to do
> 
>  providedRuntime localGroovy()

This doesn't work because gradle enforces having a groovy configuration to run 
groovy.  You will get the error: 
Execution failed for task ':compileTestGroovy'.
Cause: You must assign a Groovy library to the groovy configuration!

Luke Taylor wrote:
> Check out this issue too:
> 
> http://jira.codehaus.org/browse/GRADLE-1124
> 
> On 19/08/2010 12:52, Steve Appling wrote:
>> How can I use groovy only for testing?  If I declare a groovy configuration 
>> under dependencies (which I have to do to use groovy at all), then I get the 
>> groovy-all jar in my WEB-INF/lib of my war.  I want to use groovy (and 
>> spock) for testing, but not ship it.


This issue is exactly what I am running into, thanks for pointing it out.  The 
workaround that Adam suggested there doesn't seem to work exactly, but 
something close does.  I'll update that Jira with my change.  I ended up using :
configurations { 
   compile.extendsFrom = [providedCompile]
   testCompile.extendsFrom groovy
}

Thanks for all the ideas.  It's great to have a responsive community when your 
brain isn't working well.

--
Steve Appling
Automated Logic Research Team





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to