I’m getting a strange behaviour during configuration phase. All the EXEC tasks are the last tasks to be run before the execution phase. Is there a way to preserve the order during configuration. Check this example:
task one {
println 'Loading odbc drivers'
}
task two (type:Exec) {
println "Executing a custom shell script wich generates a XML"
commandLine "myscript.sh"
}
task three (dependsOn:two) {
println "Reading the XML generated"
}
task four (dependsOn:three) {
println "Do some SQL commands"
}
task five (type:Exec, depensOn:four) {
println "Executing sqlplus for some sql file"
commandLine "sqlplus.... blablabla"
}
task six (depensOn:five) << {
println "Finish the build"
}
And after the command:
gradle -q six
I’m expecting this order
Loading odbc drivers
Executing a custom shell script wich generates a XML
(XML generated)
Reading the XML generated
Do some SQL commands
Executing sqlplus for some sql file
(sqlplus run)
Finish the build
But I got an error cause of this order:
Loading odbc drivers
Executing a custom shell script wich generates a XML
Reading the XML generated
Do some SQL commands
Executing sqlplus for some sql file
(XML generated)
(sqlplus run)
Finish the build