On Apr 17, 2009, at 5:03 PM, Hans Dockter wrote:
On Apr 17, 2009, at 4:47 PM, Steve Appling wrote:
Hans Dockter wrote:
With the new resolver notation all the paramter are named via the
map notation. Name is now optional.
For flatDir you either have to specify rootDir or rootDirs. The
first takes a single argument the second one a list.
flatDir(rootDir: "$path")
flatDir(rootDirs: ["$path1", "$path2"]
The objective for having two parameters is that a single root dir
is so common, that we want to save our users the list notation in
this case. Of course we could have one parameter and accept normal
objects and lists and then figure this out. But how should we name
this parameter in regard to the singular/plural here. Thought?
I like having a single parameter with the plural name that could
work with either a list or the normal object. This seems
consistent with methods in other places that take a var arg list of
parameters - like Project.defaultTasks(String... defaultTasks).
You don't feel a need to make a singular Project.defaultTask(String
task).
Supporting both a normal object and a list is a little more awkward
to implement, but easier to use.
Should we call the parameter rootDir (as it is now) or just dir?
I like 'dirs'.
mavenRepo(rootRepo: "$url1", jarOnlyRepos: ["$url1", "$url2"])
Should we call the parameters rootRepo and jarOnlyRepos, or should
we call them root and jarOnly?
I like:
mavenRepo(urls: ['http://primary url', 'http://first jar
alternate', 'http://second jar alternate'])
Just specify that the pom is only retrieved from the first url in
the list.
As setting the jarOnlyRepos is not that common, there is no
singular version of this parameter.
- Hans
I like all your proposals. They simplify the API. That what I have
hoped for with my posting :)
This is now committed.
Thanks
- Hans
--
Hans Dockter
Gradle Project lead
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email