You can use the second way to declare task types on gradle.
task senchaCmdBuild {
doLast {
exec {
workingDir 'src/main/app/MYAPP'
commandLine 'cmd', 'c', 'sencha app build'
}
exec {
workingDir 'src/main/app/MYOTHERAPP'
commandLine 'cmd', 'c', 'sencha app build'
}
}
}
You need put the exec method in doLast in order to be executed only on execution flow