I wanna run multiple gradle tasks as one. So instead of
./gradlew clean build publish
I want to have a custom task
./gradl
If you need to execute some tasks in predefined order, then you need to not only set dependsOn, but also to set mustRunAfter property for this tasks, like in the following code:
task cleanBuildPublish {
dependsOn 'clean'
dependsOn 'build'
dependsOn 'publish'
tasks.findByName('build').mustRunAfter 'clean'
tasks.findByName('publish').mustRunAfter 'build'
}
dependsOn doesn't define an order of tasks execution, it just make one task dependent from another, while mustRunAfter does.