On 13/02/10 7:39 AM, Peter Ledbrook wrote:
Hi,

I have this code in a build file:

   sourceSets {
       main {
           groovy {
               compileClasspath = configurations.provided
           }
       }
   }

This works fine. However, if I change it to:

   sourceSets.main.groovy.compileClasspath = configurations.provided

I get an exception:

   groovy.lang.MissingPropertyException: No such property:
compileClasspath for class:
org.gradle.api.internal.file.DefaultSourceDirectorySet

Is this supposed to happen?

The compileClasspath is actually a property of sourceSets.main (of type SourceSet), rather than sourceSets.main.groovy (of type SourceDirectorySet).

The first example works because the groovy { } closure delegates to its owner main { } closure when it can't find compileClasspath. And the main {} closure delegates to the SourceSet, which does have the property.


--
Adam Murdoch
Gradle Developer
http://www.gradle.org


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

   http://xircles.codehaus.org/manage_email


Reply via email to