Hi Chris
1) there is a colon missing after type.
task "rarFor_$file.name" (type Jar)
should be
task "rarFor_$file.name" (type: Jar)
2) With the code below, you can get a task by name:
Task task = project.tasks.findByPath("rarFor_$file.name")
Cheers, Etienne
On 27.10.2010, at 16:10, chris wrote:
>
> I'm trying to grab a dynamic task to assign to the archives' artifacts. I'm
> sure it must be easy but I'm missing the trick to actually get the task.
>
>
>
> afterEvaluate { project ->
> // ...
>
> rarDirs.each { file ->
> task "rarFor_$file.name" (type Jar) {
> // ...
> }
>
> artifacts {
> // something like (doesn't work):
> archives getTask("rarFor_$file.name")
> }
> }
> }
>
>
>
> Any ideas?
> Cheers,
> Chris.
> --
> View this message in context:
> http://gradle.1045684.n5.nabble.com/Adding-a-dynamic-task-to-a-configuration-s-artifacts-tp3238773p3238773.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
Etienne Studer
Senior Software Developer
Canoo Engineering AG
Kirschgartenstrasse 5
CH-4051 Basel
T +41 61 228 94 44
F +41 61 228 94 49
[email protected]
www.canoo.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email