On 27/03/10 5:26 PM, Geronimo M. H. wrote:
On Friday 26 March 2010 14:06:41, Geronimo M. H. wrote:
How can I define the map, so that the keys of the map are the values and
not the names of the defined keys (from above)?
I moved the map creation into a constructor

    def targetSubDir = [:]

    SRProjectTypes() {
       targetSubDir[LibraryType]     = 'lib'
       targetSubDir[ProcessType]     = 'ext'
       targetSubDir[ServiceType]     = 'srv'
       targetSubDir[ApplicationType] = 'ext'
       targetSubDir[ThemeType]       = 'ext'
       targetSubDir[StandaloneType]  = '.'
    }

targetSubDir = [:]
targetSubDir[LibraryType] = '..'

will use LibraryType as the key, whereas

targetSubDir = [LibraryType: '...']

will use 'LibraryType' as the key (ie the string 'LibraryType')

This is a Groovy behaviour. But I guess it is an example of where learning Groovy and Gradle at the same time can be a bit confusing.


--
Adam Murdoch
Gradle Developer
http://www.gradle.org


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

   http://xircles.codehaus.org/manage_email


Reply via email to