https://kotlinlang.org logo
#detekt
Title
# detekt
a

Aditya Bhaskar

11/20/2023, 4:06 PM
Bit of a lazy web question: Does anyone have a custom gradle task that can run detekt across all modules with type resolution? E.g. it runs
detektDebug
on Android modules and
detektMain
and
detektTest
on JVM modules.
1
b

Brais Gabin

11/20/2023, 6:49 PM
DetektMain also runs detektDebug on android.
If you don't want to run detektRelease you can disable that build type.
It is on the documentation of detekt with gradle.
This way you can just run
gradle detektMain detektTest
a

Aditya Bhaskar

11/20/2023, 6:51 PM
Thanks. It wasn't clear between
Main
(and
Test
) vs build type based.
Does
detektTest
also cover the
androidTest
sources in Android modules, or just JVM test sources?
b

Brais Gabin

11/20/2023, 6:53 PM
If there's something that can be improved in the documentation please open an issue, or even better, a PR with that improvement.
a

Aditya Bhaskar

11/20/2023, 6:55 PM
Thanks. I'd missed the section within brackets against each type here. They're very clear about both my questions. https://detekt.dev/docs/gettingstarted/gradle#:~:text=Android%3A%20all%20production%20source%20sets)