On 22/02/10 6:14 AM, Peter Niederwieser wrote:
Taking this further, how can I iterate over all (not just compile)
dependencies, including source and javadoc Jars?

I don't think it's pretty. Hopefully, in the 0.10 release, we'll try to make this easier (given it's the 2nd and 6th highest voted feature in JIRA)

You need to end up with a configuration that contains, for each module you're interested in, an artifact dependency with a 'source' classifier, or with a 'javadoc' classifier. Here's an example:

configurations {
    sources
}

dependencies {
    modules.each { module ->
sources "$module.moduleGroup:$module.moduleName:$module.moduleVersion:source"
    }
}


To get the modules you need, you could get the resolved modules from the configurations you're interested in. For example, to get the direct dependencies of the testRuntime configuration:

def modules = []
modules << configurations.testRuntime.resolvedConfiguration.firstLevelModuleDependencies

Have a look at the Javadoc for more options:

http://gradle.org/latest/docs/javadoc/org/gradle/api/artifacts/Configuration.html
http://gradle.org/latest/docs/javadoc/org/gradle/api/artifacts/ConfigurationContainer.html

Cheers,
Peter


Hans Dockter wrote:
Is this what you are looking for:

configurations.compile.each { file ->
    ...
}


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