On 24/11/2011, at 7:52 PM, Russel Winder wrote:

> On Thu, 2011-11-24 at 19:21 +0000, Luke Daley wrote:
> [...]
>> Declare the dependency in the buildscript {} block in assemble.gradle.
> 
> Aha.  Obvious, but only in hindsight after being prompted :-)
> 
>> Or do you have that and it's not working for you?
> 
> All I now have to worry about is how this ever worked in 0.9.2!
> 
> Actually another problem is that I now have:
> 
>        buildscript {
>          repositories {
>            mavenCentral ( )
>          }
>          dependencies {
>            classpath "commons-io:commons-io:2.1"
>          }
>        }
> 
> in build.gradle before the apply "call" of the Gradle script that uses
> FileUtils, but I am still getting:
> 
>        * Where:
>        Script 
> '/home/users/russel/Repositories/Git/Clones/Groovy/gradle/assemble.gradle' 
> line: 2
> 
>        * What went wrong:
>        Could not compile script 
> '/home/users/russel/Repositories/Git/Clones/Groovy/gradle/assemble.gradle'.
>        Cause: startup failed:
>        script 
> '/home/users/russel/Repositories/Git/Clones/Groovy/gradle/assemble.gradle': 
> 2: unable to resolve class org.apache.commons.io.FileUtils
>         @ line 2, column 1.
>           import org.apache.commons.io.FileUtils
>           ^
> 
>        1 error
> 
> which is a wee bit disappointing, I had at least been hoping for a
> different error! I then moved the buildscript call from build.gradle to
> gradle/assemble.gradle befor all the imports and I got different errors.
> So this is definite progress.  

What were the new errors?

> However I am confused as to why the
> buildscript call has to be in gradle/assemble.gradle rather than being
> in the build.gradle.
> 
> I suspect I am missing something very simple.

Each script has its own class loader hierarchy to prevent clashes and 
pollution. There is an inconvenience cost though and AFAIK we haven't resolved 
to do anything about it in the short term, but Adam will have a better 
perspective on that.

-- 
Luke Daley
Principal Engineer, Gradleware 
http://gradleware.com


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

    http://xircles.codehaus.org/manage_email


Reply via email to