On Jul 22, 2009, at 4:31 PM, Philip Crotwell wrote:


A good solution to this problem would be to have an additional method in the configuration that returns an object which returns the artifact metadata (name, version, ...) together with the artifact file. This is something we
will offer in 0.8:


Maybe instead of the Configuration being a collection of File objects,
you could have it be a collection of DependencyFile that extends File
and implements Dependency so that existing methods still work (they
are still Files), but you have access to the group, name and version?


This is a very good idea. The problem is that we also have the type of a self resolving dependency, which does not have the above properties. They simply correspond to a set of files.

An alternative approach would be to have a files method with a transformer closure.

files { artifact -> "$artifact.name-${artifact.version}.$ {artifact.ext} }

This method would return the files for all dependencies (self resolving and what we call module dependencies which are associated with external repositories). The files for the module dependencies are generated from the return value of the closure (which can be a String or a File object).

- Hans

--
Hans Dockter
Gradle Project Manager
http://www.gradle.org


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

   http://xircles.codehaus.org/manage_email


Reply via email to