You should be able to do something like this as well if you prefer:
def configureExec = { task, projectName, outputDir, cmdLine = ['bower,
install'] ->
task.workingDir "src/test/resources/projects/$projectName"
task.commandLine cmdLine
task.inputs.files file("${task.workingDir}/component.json")
task.outputs.files file("${task.workingDir}/$outputDir")
}
task initStandardProject(type: Exec){ task ->
configureExec(task, 'standard', 'components')
}
task initCustomDirProject(type: Exec){ task ->
configureExec(task, 'customDir', 'web-app')
}
task initNonStandardProject(type: Exec){ task ->
configureExec(task, 'nonStandard', 'lib', ['bower', 'install',
'--directory=lib'])
}
processTestResources.dependsOn initStandardProject
processTestResources.dependsOn initNonStandardProject
processTestResources.dependsOn initCustomDirProject
--
View this message in context:
http://gradle.1045684.n5.nabble.com/defining-a-task-based-on-another-pre-configured-task-tp5710571p5710576.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email