is not recognizable. I would like to avoid to configure
detekt
in all subprojects, that's what I'm really trying to do. Anyone have done this before?
a
araqnid
04/29/2020, 4:03 PM
Because you’re dynamically applying the detekt plugin using
apply
, the Kotlin code for the build file doesn’t have the helper for the detekt extension available. You’ll have to replace the
detekt {
bit with an explicit reference to the class to configure, e.g.
the<DetektExtension>().apply {
👍 1
🤔 1
araqnid
04/29/2020, 4:08 PM
To expand on that: Gradle grabs the head of the build scripts and manually parses the
plugins{}
bit, and uses that to figure out which plugins to load and generates some “glue” for the Kotlin DSL - you can see this generated code for any project with sth like
./gradlew subproject:kotlinDslAccessorsReport
— if you manually add the plugins block to a subproject and run that, you should be able to see what the implementation of the
Project.detekt { }
extension would be
👏 1
👍 1
x
x80486
04/29/2020, 4:13 PM
I see what you meant...let me play with that! Thanks again! Still,
detekt
behaves strange, it reports the issues for every module in all modules 🤷♂️