-
Hi there, I am trying to enable type resolution and my Android project has multiple subprojects (i.e. gradle modules). I would like to run detekt on all of my modules (main + sub) but what I'm seeing (https://detekt.dev/docs/gettingstarted/type-resolution) is in order to do that I'd need to use detekt or detektMain. The problem is using either of those will only run detekt on the main module and never includes source code from my subprojects. How can I get this working? I tried doing some trickery using subprojects {} in my main build.gradle file but it doesn't seem to work. I've also looked all over the detekt main site and am not finding something that will work. I saw this article (https://madhead.me/posts/detekt-faster/) but after converting to groovy dsl it just didn't work. Can anyone lend a hand? If this is not possible then what's the alternative? Do I need to create a detekt task inside of every gradle module and run independently? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you run |
Beta Was this translation helpful? Give feedback.
If you run
./gradlew detektMain
you'll be executing the task calleddetektMain
on all of your submodules. You need to make sure you configure detekt for all the subprojects also. You can check out this template which has Detekt configured: https://github.com/cortinico/kotlin-android-template/