I suspect this is a pretty noob question, howver I just cannot get my head around this one.
I am trying to create some wrappers around legacy build tools such as GNU Make & SCons as part of a migration. The idea is to create some Task classes to do this, but since these would really just be calling out to executables I thought it would be great if I could just re-use most of what already happens with the Exec task.
An example of this code is on Gist: https://gist.github.com/ysb33r/5554324
I would like to have some additional properties such as targets. i.e should the target be ‘install’, the task would end-up calling ‘make install’. It would achieve this by setting executable and args properties. As per the code snippet in the link, I would like to this to happen transparently to the caller. The latter should only need to set the targets property in the closure as which is the convention for tasks. When the tasks is executed it should automatically populate ‘args’ in the parent ‘Exec’ task.
For custom tasks one would just use doFirst to achieve this, but how to achieve this inside a task class?