On 21/06/2011, at 12:07 AM, Gerwin Jansen wrote:
> subprojects {
> apply plugin: 'java'
>
> def getDependency(projectname) {
> compDir = file(rootDir.getAbsolutePath() + '/components/' +
> projectname);
> if(compDir.exists() && compDir.directory) {
> return project(':'+projectname)
> }
> else {
> return 'Cordys:' + projectname + ':unspecified'
> }
> }
> }
The problem is that you are trying to define a method in a closure, which can't
work.
If you change from ”def getDependency(projectname) {” to “getDependency = {
projectname ->” then it will work because you will be assigning a closure
property to the project object for all subprojects. You would call it the same
way you would previously.
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
Please vote Gradle for JAX Awards » http://vote.jax-awards.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email