Skip several tasks in Gradle quickly
Published in
2 min readDec 7, 2016
Sometimes we need to build our project without a particular task, like lint
, test
or findbugs
. Other times we just want to improve our gradle build time by skipping long running tasks. There are several ways of doing that, like overriding those tasks using the onlyIf()
method to attach a predicate to it,
task myTask {
doLast {
println 'hello world'
}
}
myTask.onlyIf {…