Emanuel Moecklin
11/01/2023, 5:58 PMdetekt {
configuration is applied to all sub projects (in the main build.gradle file)
subprojects {
apply plugin: "io.gitlab.arturbosch.detekt"
detekt {
debug = false
parallel = true
config.setFrom("${rootProject.projectDir}/default-detekt-config.yml")
baseline = file("${rootProject.projectDir}/detekt-baseline.xml")
buildUponDefaultConfig = true
allRules = false
}
}
the task.detekt
configuration is ignored by sub projects:
tasks.detekt.configure {
exclude("**/test/**")
reports {
html.required.set(true)
How can I configure the Detekt task to be applied to all Gradle modules? The documentation has examples showing the task configuration included in the detekt closure/lambda but that seems to be deprecated (e.g. I get HTML report location set on detekt {} extension will be ignored for detekt task.
)Brais Gabin
11/01/2023, 6:04 PMsubprojects
lambda?Emanuel Moecklin
11/01/2023, 6:19 PMRegarding the tasks snippet. Is it inside theno, if I add it tolambda?subprojects
subprojects
I get
Could not get unknown property 'detekt' for task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.I tried retrieving the task by name but that doesn't work either
tasks.withType(io.gitlab.arturbosch.detekt.Detekt).configureEach {