It's possible to run detekt before build? (run, release...)
I followed this https://arturbosch.github.io/detekt/gradletask.html
But check.dependsOn detekt on build.gradle (app) don't do nothing...
I already tried check.dependsOn detekt and preBuild.dependsOn detekt
And tried ...dependsOn detektCheck too...
What's the error? I can't use the detektCheck task before build?
You can add detekt task before build in Run Configuration

One other option is to added it as a part the build, so it could fail the build:
tasks.whenTaskAdded {
if (name == "compileDebugKotlin") {
dependsOn(tasks.detekt)
mustRunAfter(tasks.detekt)
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With