From ecee8a3d2c63300a92a3985d715fe256fec2b7f1 Mon Sep 17 00:00:00 2001 From: tateisu Date: Sun, 13 Mar 2022 00:50:37 +0900 Subject: [PATCH] =?UTF-8?q?detekt=E3=81=AE=E3=83=AC=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=88=E5=87=BA=E5=8A=9B=E5=85=88=E3=81=AE=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d5f0e127..87c96711 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,3 +1,6 @@ +import io.gitlab.arturbosch.detekt.Detekt +import io.gitlab.arturbosch.detekt.DetektPlugin + import java.text.SimpleDateFormat apply plugin: 'com.android.application' @@ -296,29 +299,19 @@ detekt { // point to your custom config defining rules to run, overwriting default behavior config = files("$rootDir/config/detekt/config.yml") +} - // detekt 1.19.0 でレポート出力先を指定できなくなった? - // app/build/reports/detekt に出力されてる - reports { - // checkstyle like format mainly for integrations like Jenkins - xml { - enabled = true - destination = file("detektReport/${name}.xml") - } - // observe findings in your browser with structure and code snippets - html { - enabled = true - destination = file("detektReport/${name}.html") - } - // similar to the console output, contains issue signature to manually edit baseline files - txt { - enabled = true - destination = file("detektReport/${name}.txt") - } - // standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with Github Code Scanning - sarif { - enabled = true - destination = file("detektReport/${name}.sarif") +plugins.withType(DetektPlugin) { + tasks.withType(Detekt) { + reports { + xml.required.set(true) + xml.outputLocation = file("$buildDir/reports/detekt/st-${name}.xml") + html.required.set(true) + html.outputLocation = file("$buildDir/reports/detekt/st-${name}.html") + txt.required.set(true) + txt.outputLocation = file("$buildDir/reports/detekt/st-${name}.txt") + sarif.required.set(true) + sarif.outputLocation = file("$buildDir/reports/detekt/st-${name}.sarif") } } }