Eduard Boloș
09/26/2025, 2:09 PMReportMergeTask. In v1, it looks like the Detekt tasks were created only for the variants that were not being filtered out. But now in v2 they are created for all the variants, but only the ones that are not filtered out are linked to the main task as a dependency. However, that means that the merge task, when configured similar to these docs, it will trigger all the registered tasks, although some of them should ignored. I will post my configuration in the thread below, for more clarity. But the question is: am I supposed to do something differently now?Eduard Boloș
09/26/2025, 2:11 PMprivate val reportMerge by
tasks.registering(dev.detekt.gradle.report.ReportMergeTask::class) {
output.set(
rootProject.layout.buildDirectory.file(
"reports/detekt/merge.xml"
)
)
}
detekt {
basePath.set(projectDir)
parallel = true
config.from(files("${rootProject.layout.projectDirectory.dir("detekt")}/detekt-config.yml"))
ignoredBuildTypes = listOf("release", "official")
ignoredFlavors = listOf("production")
autoCorrect = false
}
tasks.withType<dev.detekt.gradle.Detekt>().configureEach {
finalizedBy(reportMerge)
}
reportMerge {
input.from(
tasks.withType<dev.detekt.gradle.Detekt>().map {
it.reports.xml.outputLocation
}
)
}Eduard Boloș
09/26/2025, 2:15 PM./gradlew sendmoney:detektMain I can see:
> Task :sendmoney:detektDebug
> Task :sendmoney:detektReleaseEduard Boloș
09/26/2025, 2:17 PMfinalizedBy(reportMerge) from the task configuration, it seems to work correctly 😅 Not sure why I had it in the first place.Eduard Boloș
09/26/2025, 3:47 PM./gradlew detektMain detektTest --continue. Now if instead I just execute reportMerge, the non-type resolution enabled detekt tasks get executed instead. Am I holding it wrong?