Question
I wanna run multiple gradle tasks as one. So instead of:
I want to have a custom task
# gradle cleanBuildPublish
that executes clean build and publish in order. How's that possible?
How-To
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:
- task cleanBuildPublish {
- dependsOn 'clean'
- dependsOn 'build'
- dependsOn 'publish'
- tasks.findByName('build').mustRunAfter 'clean'
- tasks.findByName('publish').mustRunAfter 'build'
- }
沒有留言:
張貼留言