Hi,

I'm try to do a multi-project build, and to keep my sanity I'm checking the
dependencies on a configuration I have. The problem is when I do this, it
appears to alter the list of files attached to this later on!

So I have this kind of thing:

rootProject build.gradle:

subprojects
{
    apply plugin: 'java'

    configurations {
        configServerTier // server tier jars
        configServer { // server-tier, test jars, libraries
            extendsFrom configServerTier, configTest
        }
    }
    
    // etc...

    afterEvaluate { project ->
    
        if (project.hasProperty('specialProject'))
        {
            // if following is commented, I get all my dependency libraries
for the configServer configuration, otherwise I just get project artifacts!
WHY?
            println "configServer: " +
project.configurations.configServer.files.collect { it.name }

            task testJar (type: Jar, dependsOn:
subprojects.configurations.configServer) {
                into('test') {
                    from configurations.configServer
                    from configurations.configServer.allArtifactFiles
                }
            }
        }
    }
}


subproject :core build.gradle:

configurations {
    compile { extendsFrom configServer }
}
dependencies {
    compile project(':util')
    configServer 'ecs:ecs:1.4.2'
    configServer 'com.thoughtworks.xstream:xstream:1.3'
}


subproject :anotherProject (depends on above core project) build.gradle:

specialProject = true
dependencies {
    // depend on all other projects
    rootProject.standardProjects(exclude:this.project).each {
        configServer project(path: it.path, configuration: 'configServer')
    }
    compile project(path: ':core')
}


When the println is commented I get the ecs and xstream jars in my Jar as
well as artifacts through the serverConfig configuration. When the println
is executed, all I get is the artifacts - no ecs or xstream.

What's going on? Why would a println affect the configuration?

Thanks in advance for any help,
Cheers,
Chris.
-- 
View this message in context: 
http://gradle.1045684.n5.nabble.com/printing-configuration-dependencies-alters-the-list-of-files-tp3232403p3232403.html
Sent from the gradle-user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email


Reply via email to