Skip several tasks in Gradle quickly

Francisco Riádigos
AndroidPub
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 {…

--

--

Francisco Riádigos
AndroidPub

Former @LloydsBank, @BritishAirways, @SkyUK, @Wefox, @Indra... Co-founder @Chatty