https://kotlinlang.org logo
Title
j

Javier

03/09/2023, 4:28 PM
Is it planned to do a release with Gradle 8 compatibility?
Reason: Task ':detekt' uses this output of task ':foo:compileKotlin' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    Possible solutions:
      1. Declare task ':foo:compileKotlin' as an input of ':detekt'.
      2. Declare an explicit dependency on ':foo:compileKotlin' from ':detekt' using Task#dependsOn.
      3. Declare an explicit dependency on ':foo:compileKotlin' from ':detekt' using Task#mustRunAfter.
Looks like it is registering the
detekt
task in the root project even if I am not applying the plugin in the root project. Anyone can confirm that is being done on the Detekt Gradle Plugin? As Gradle does naming matching, it is unnecessary to do that.
p

PoisonedYouth

03/09/2023, 5:52 PM
Are you sure this is a general issue? I use Detekt 1.22.0 with Gradle 8.0 and everything works as expected without warning
j

Javier

03/09/2023, 5:54 PM
Do you have a multiproject?
I am trying to find if I am registering the
detekt
task by myself but I can't find it
Curiously, the issue is not happening if I run
detekt
directly, it was happening if I run
build
p

PoisonedYouth

03/09/2023, 5:56 PM
No it's just a multimodule project.
j

Javier

03/09/2023, 5:57 PM
I am going to investigate it more, really weird situation
Looks like it is a dependency between modules, like one module is depending on another one and that happens
Is it possible that detekt is aggregating modules which depends on? current setup is •
foo
foo-consumer
(
api(project(":foo"))
And it fails because multiple tasks from other plugins (spotless, and so on), from one module, crashes with the detekt one in another module, for example
:foo:detekt
fails because
:foo-consumer:spotlessKotlin
e

eygraber

03/09/2023, 7:05 PM
I have a similar setup (no spotless though) and I'm not seeing this issue
j

Javier

03/10/2023, 11:18 AM
I found the issue, it was related to setting the sources on detekt task (something I was doing since the first setup a lot of years ago)
I had another workaround to get a detekt report on the root with that, I mean, I was setting the root dir as sources, I think @ephemient is doing it too, so maybe he will face this issue too