Created
December 27, 2022 12:53
-
-
Save devniel/6ec010ddfb76457dd32aeac2a9e87b91 to your computer and use it in GitHub Desktop.
Excluding a task [gradle]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Excluding a task | |
task1 { | |
dependsOn taskChain | |
// it will only disable task3 | |
// but not its dependencies | |
task3.enabled = false | |
} | |
task2 { | |
// it will override task1 test.enabled config | |
task3.enabled = true | |
} | |
task2 { | |
doLast { | |
// ignored | |
task3.enabled = true | |
} | |
} | |
// Alternative 1 | |
task3.onlyIf { project.hasProperty('withTask3') } | |
// Alternative 2 | |
// From outside | |
./gradlew task1 -x task3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment