Technology Consulting
Return to: Gradle Reference

Create a Custom Clean/Build/Publish Task

How to create a custom Gradle task to execute Clean/Build/Publish with one click

Add the following:

tasks.register('cleanBuildPublish') {
    dependsOn 'clean'
    dependsOn 'build'
    dependsOn 'publish'
    tasks.named('build').get().mustRunAfter('clean')
    tasks.named('publish').get().mustRunAfter('build')
}
Return to: Gradle Reference