evgeny-goldin/gradle-plugins — pull request #8 by johnrengelman (2013-11-11 14:17:22+00:00)
Title: Usability Updates - node version installation, task configuration

A couple updates to the plugin after trying to use it in an plugin.
1) Put a check in place so the setup task doesn't try to install a node version that is already present in NVM. Instead just `nvm use` it.
2) When overriding the plugin configuration at the task level using the `config { ... }` method, the new extension instance is available as an argument to the closure. This change sets the delete of the closure to be the extension as well, so configuration can be more concise:
Before:
```
task run(type: RunTask) {
config { ext ->
ext.run = ['grunt test']
}
}
```
After:
```
task run(type: RunTask) {
config {
run = ['grunt test']
}
}
```
3) Add a wrapper method to the base tasks (except TeamCity because that didn't match the other ones) that wraps the config method with the same name as the plugin extension. This allows the above example to be rewritten as:
```
task run(type: RunTask) {
node {
run = ['grunt task']
}
}
```
This makes configuration a little more explicit when combined with the changes in #2 since the configuration at the task level looks identical to the configuration of the plugin at the project level.