Yes, that works nicely thanks very much! I guess there is no way to get
the file type from the api so you just have to parse the file name.
What's the reason for using getAllDependencies(ExternalDependency)?
Does that exclude inter-module dependencies?
On 07/18/2010 12:16 AM, Levi Hoogenberg wrote:
> Does the following script (which I tested with 0.9-preview-3) do what
> you want? (And how does it differ from your own solution? I wouldn't
> directly call it unelegant.)
>
> apply plugin: 'java'
>
> dependencies {
> compile group: 'org.slf4j', name: 'slf4j-api', version: '1.6.0'
> }
>
> task listDependencies << {
> configurations.compile.getAllDependencies(ExternalDependency).each
> {dependency ->
> configurations.compile.files(dependency).each {file ->
> println "${dependency.group}:${dependency.name
> <http://dependency.name>}:${file.name.split('\\.')[-1]} =
> ${file.canonicalPath}"
> }
> }
> }
>
> On Sun, Jul 18, 2010 at 6:39 AM, Paul Gier <[email protected]
> <mailto:[email protected]>> wrote:
>
> I have a set of compile dependencies, and I would like to generate
> properties that look like this:
> group:name:type = /path/to/jar
>
> For example a junit dependency would give something like
> junit:junit:jar = /home/me/.gradle/junit/junit-4.3.jar
>
> I'm able to get the dependency linked to the file using a combination of
> configurations.compile.files and configurations.compile.dependencies but
> it's not very elegant, and I can't figure out how to get the file type.
> Is there an easy way to do this?
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email