On 14/01/10 11:05 PM, Nacho Coloma wrote:
Hi all,

My current setup is a plain folder structure with three projects: projectA, projectB and master. My settings.gradle file contains this:

includeFlat 'projectA', 'projectB'

I have included in master/build.gradle the following new task:

subprojects {

usePlugin('java')

task 'genlib'(description: 'Copies the 3rd party libraries to /genlib', dependsOn: configurations.compile) << {
        print "(for debug only) ==>" + configurations.compile.files
        copy {
            into "${projectDir}/src/main/genlib"
            from configurations.compile.files
        }
    }

}

I have specified a different set of dependencies in projectB and projectA

If I execute this:

cd projectA
gradle -i genlib

I get the dependencies of projectB instead of projectA!! If I remove projectB from settings.gradle it works as expected. Am I missing something?


You're running into a bug with the subprojects() method: http://jira.codehaus.org/browse/GRADLE-708

It has been fixed in trunk, and the fix will be included in the upcoming 0.9 release.

You could use the Copy task instead of the copy() method to work around this problem (it's arguably a better approach anyway). For example:

subprojects {

    usePlugin('java')

task 'genlib'(type: Copy, description: 'Copies the 3rd party libraries to /genlib') {
            into "${projectDir}/src/main/genlib"
            from configurations.compile
    }

}


--
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