Hi Rene,
On Fri, Feb 11, 2011 at 8:45 PM, Rene Groeschke <[email protected]> wrote:
> Hi there,
>
> I want to use a set of jars in a copyspec. To group the jars we have the
> following line of code:
>
> --------
> distJars = tasks.withType(Jar).matching({ jar -> !jar.appFileJar }
> --------
>
> For a single jar I know I can write something like this in my copyspec:
> --------
> "from jar.output.files"
> --------
>
cool. I haven't thought about that approach yet.
We always wanted to make an archive task natively understood by a copy spec.
But looking at that we should apply this pattern for any task:
from [taskName] (which copies the output files)
from [taskContainer] (which copies all the output files of all the tasks)
But the latter should be done lazily.
In your case: from distJars*.outputs.files does not copy jars which are
added later then this statement is evaluated. So you can't use it in a
plugin which wants to add a copyAllJar task for example.
There is an easy solution for that right now. Just use a closure:
from { distJars*.outputs.files }
But 'from distJars' would read much nicer :)
Could you file a Jira?
Thanks
Hans
--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz
> actually I have this snippet:
>
> --------
> ....
> into("dist)
> distJars.all.each{
> from it.outputs.files
> }
> }
> ...
> --------
>
> is there an elegant way to do this kind of autowiring for a set of jars?
>
> regards,
> René
>
> --
> ------------------------------------
> Rene Groeschke
>
> [email protected]
> http://www.breskeby.com
> http://twitter.com/breskeby
> ------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>