questions about AbstractArchiveTask

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

questions about AbstractArchiveTask

Ittay Dror
1. why the use of 'self' variable and not 'this'?

2. how is dependencyManager set for this class?

Thanks,
Ittay
Reply | Threaded
Open this post in threaded view
|

Re: questions about AbstractArchiveTask

hans_d
Administrator

On Jun 17, 2008, at 7:36 AM, Ittay Dror wrote:

>
> 1. why the use of 'self' variable and not 'this'?

This is an ugly work around of a Groovy deficiency. It causes bugs  
regularly, as one forgets to add self.

See: http://groovy.markmail.org/search/?q=from%3Ahans+dockter+meta- 
magic#query:from%3Ahans%20dockter%20meta-magic+page:1
+mid:di4xu3sqx6g4mgpx+state:results

An alternative to self would be to use getters and setters. But the  
best solution is that Groovy becomes as dynamic as you would expect  
from a dynamic language.

- Hans

>
> 2. how is dependencyManager set for this class?

It is set via conventionMappings by the Java Plugin. This information  
is usually bundled in the class DefaultConventionsToPropertiesMapping.

A convention mapping is a mapping between a property and a closure.  
The closure takes the convention object as an argument. The result of  
the closure call is used as the value for the property.

- Hans

>
> Thanks,
> Ittay
> --
> View this message in context: http://www.nabble.com/questions-about- 
> AbstractArchiveTask-tp17878488p17878488.html
> Sent from the gradle-dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

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





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

    http://xircles.codehaus.org/manage_email