Narco wrote:
I need to take all third party artefacts from multi-project and copy to one
folder to use them with IDE afterthen. This means I don`t need compilation
or anything else there. From APIs I found that this should work:
configurations {
compile
localArchives.extendsFrom (compile)
localArchives.exclude(group: 'my.company.group') }

However, when calling localArchives.allDependencies from some task gradle
still tries to resolve internal modules from repository so exclude is
ignored. For now I have dirty hack:
project.configurations {
            compileLib
            compile.extendsFrom (compileLib)
            testCompileLib
            testCompile.extendsFrom (testCompileLib)
            localArchives.extendsFrom (compileLib, testCompileLib)
        }

Please help me to make it good looking with only one additional
configuration or none at all.

Here is an example task you can add to the root project. It will copy all the external dependencies for all subprojects into the 'libs' directory. It doesn't need any extra configurations, nor will it try to build any project dependencies.

task libs(type: Copy) {
   File libsDir = file('libs')
   doFirst {
       ant.delete(dir: libsDir)
   }
   into libsDir
   // you might want the testCompile or testRuntime configuration instead
from { subprojects.collect { it.configurations.runtime.copyRecursive(DependencySpecs.type(Type.EXTERNAL)) } }
}


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