On Feb 26, 2009, at 4:09 PM, Martin Vlcek wrote:


I would rather stay more closely to the current syntax and merge some of your
suggestions to make it more like groovy instead of a java builder:

configurations {
   newConf extends:compile, ...
   // and alternatively
   newConf {
       extends = compile
       ...
   }
}

repositories {
   // like spring DSL in grails the first parameter is the class
   publishRepo(OfficialMavenResolver)
   otherRepo(FlatFileResolver) {
       dir = '/some/path/to/the/resolver/directory'
       ...
   }
   // and as alternative format specify all setters map-like after the
first parameter
   otherRepo2 FlatFileResolver, dir:'/some/path'
}

dependencies {
   // unchanged
   compile 'junit:junit:4.+'
   // extended syntax to specify (nearly) all possible ivy descriptors
(including configuration!)
compile [org:'my.org', name:'myname', version:'1.+', conf:'myConf'],
              [org:'my.org', name:'myothername', version:'0.+',

Unfortunately you need parentheses if you pass map literals.

meth a: 'b'  // is fine
meth [a: 'b'] // invalid, has to be meth([a: 'b'])

I'm wondering if some linking word like dependsOn makes the whole thing a nicer read. I'm not sure. But then again, the dot we need for this would introduce a different style to how we declare things at other places. So we might use the syntax as you have proposed it, which is similar to what we do now (except for the notation). In general, it is a pity, that you can't pass multiple maps without parentheses.

<snip>

- Hans

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





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

   http://xircles.codehaus.org/manage_email


Reply via email to