Last active
October 18, 2023 19:11
-
-
Save SelfFormat/cfca8543df3e56730987c2ac2a442e28 to your computer and use it in GitHub Desktop.
detekt multi module gradle configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id "io.gitlab.arturbosch.detekt" version "1.16.0" | |
} | |
def projectSource = file(projectDir) | |
def configFile = files("$rootDir/config/detekt/detekt.yml") | |
def baselineFile = file("$rootDir/config/detekt/baseline.xml") | |
def kotlinFiles = "**/*.kt" | |
def resourceFiles = "**/resources/**" | |
def buildFiles = "**/build/**" | |
apply plugin: 'io.gitlab.arturbosch.detekt' | |
tasks.register("detektAll", io.gitlab.arturbosch.detekt.Detekt) { | |
def autoFix = project.hasProperty('detektAutoFix') | |
description = "Custom DETEKT build for all modules" | |
parallel = true | |
ignoreFailures = false | |
autoCorrect = autoFix | |
buildUponDefaultConfig = true | |
setSource(projectSource) | |
baseline.set(baselineFile) | |
config.setFrom(configFile) | |
include(kotlinFiles) | |
exclude(resourceFiles, buildFiles) | |
reports { | |
html.enabled = true | |
xml.enabled = false | |
txt.enabled = false | |
} | |
} | |
dependencies { | |
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.16.0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment