gradle-infrastructure icon indicating copy to clipboard operation
gradle-infrastructure copied to clipboard

detekt: Better type resolution integration

Open osipxd opened this issue 4 years ago • 2 comments

It is not transparent to users how to use detekt tasks with type resolution if it is not listed in ./gradlew tasks. I think type resolution should be configured from config and not from task name.

osipxd avatar Nov 22 '21 17:11 osipxd

API might be like:

redmadrobot {
    detekt {
        useTypeResolution("release") // Here we can configure variant for android projects
    }
}

After this:

  • detekt plugin should be applied to all subprojects (where kotlin plugin is applied)
  • task detektAll should depend on the release detekt tasks with type resolution

osipxd avatar Dec 15 '21 11:12 osipxd

Found another problem of current approach. It is impossible to depend task on detekt[BuldVariant]All task because it will not be created if gradle command not includes detekt*All pattern. So it is impossible to create task like this:

tasks.register("ciCheck") {
    // ...
    dependsOn("detektReleaseAll")
}

osipxd avatar May 06 '22 08:05 osipxd