groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Schalk Cronjé <ysb...@gmail.com>
Subject compile vs compileOnly in Gradle projects for Groovy LIbraries
Date Sun, 16 Apr 2017 21:38:42 GMT
I am wondering what people's approach is to build Groovy libraries with 
Gradle. Most people will probably use something like

    dependencies {
         compile 'org.codehaus.groovy:groovy-all:2.4.7'
    }

which will set the appropriate Groovy version as a dependency. This can 
obvisously lead to some interestign Groovy version resslution when 
combining multiple libraires with different Groovy versions as dependencies.

For a number of projects I have worked on, I have adopted the 'provided' 
scope via the Nebula plugin, or since 'compileOnly' has become available 
in Gradle defaulted to that i.e.

    dependencies {
         compileOnly 'org.codehaus.groovy:groovy-all:2.4.7'
    }

This obviously means that the consumer of one of my Groovy libraries has 
to explicitly state which version of Groovy they require, but IMO it is 
better that way as it gives them more control.

Thoughts?

-- 
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r


Mime
View raw message