I have gradle task:
task immportMyData(type: Exec) {
def dumnp= ""
new File("${System.env.MY_HOME}/export").eachDir() { dir ->
dumpName = dir.getName()
}
workingDir "${System.env.MY_HOME}/../test"
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
}
}
...
As I understand its task configuration, because its executed every time.
So, is there any way how to move code from conflagration step to task body (execution step) ? Some thinks like this.
task immportMyData(type: Exec) << {
//code from configuration
}
another worlds
task immportMyData(type: Exec) **<<** {
def dumnp= ""
new File("${System.env.MY_HOME}/export").eachDir() { dir ->
dumpName = dir.getName()
}
workingDir "${System.env.MY_HOME}/../test"
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
}
}
I've checked gradle docs, but no luck