I am having an issue with with the detekt task and...
# community-support
j
I am having an issue with with the detekt task and Gradle 8.0, this is the setup: •
:gradle-extensions
(it has no code, it just add more subprojects using api(...), like it was an index of all projects) •
:gradle-extensions-subprojects:gradle-logging-extensions
And the error is this one:
Copy code
Reason: Task ':gradle-extensions:detekt' uses this output of task ':gradle-extensions-subprojects:gradle-logging-extensions:spotlessKotlin' 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 ':gradle-extensions-subprojects:gradle-logging-extensions:spotlessKotlin' as an input of ':gradle-extensions:detekt'.
      2. Declare an explicit dependency on ':gradle-extensions-subprojects:gradle-logging-extensions:spotlessKotlin' from ':gradle-extensions:detekt' using Task#dependsOn.
      3. Declare an explicit dependency on ':gradle-extensions-subprojects:gradle-logging-extensions:spotlessKotlin' from ':gradle-extensions:detekt' using Task#mustRunAfter.
As you can see in the
Reason
, the
detekt
task is on the
gradle-extensions
module, and the the
spotlessKotlin
in a different module. I have tried to do
detekt.mustRunAfter(_tasks_.findByName("spotlessKotlin"))
, but that dependency would work with tasks on the same project