On Jul 23, 2009, at 9:24 PM, Tomek Kaczanowski wrote:

hi,

one of the first Gradle features presented in the user guide, are
"dynamic tasks"
(http://www.gradle.org/0.7/docs/userguide/ userguide_single.html#N10234).
My question is, what do you use them for ? Or at least what are
potential uses of this feature ?

First off all this example is supposed to demonstrate that you can apply the dynamic potential of Groovy also for creating the tasks not just the actions. That might look obvious but for people coming from the static world of xml scripts that might not be evident. Having said this, I don't think there are that many use cases. One use case for example could be, that you might want to write a wrapper for a Maven build. You could do:

['clean', 'compile', 'test', 'package'].each { name ->
   tasks.add(name) {
      name.execute()
   }
}

Other dynamic scenarios are better solved with synthetic tasks (i.e. task rules)

- Hans

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


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

   http://xircles.codehaus.org/manage_email


Reply via email to