What's the order of tasks during configuration phase?

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

Most of your task bodies are executing during the configuration phase, not the execution phase. Read the user guide for information about how to properly define tasks.

@David_Karr is perfectly right.

During configuration phase, your build script is parsed, and the println from your task are executed in the order they are defined in the file.
The commandLine is part of the task action, and is therefore called during execution phase.