From 7707f18de037934b0fe5fabfa25b4980738d9135 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Wed, 20 Jul 2022 04:03:18 +1000 Subject: [PATCH] Make verifyGeneratorOutput task configuration cache compatible (#5100) --- detekt-generator/build.gradle.kts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/detekt-generator/build.gradle.kts b/detekt-generator/build.gradle.kts index e1a96393dcb..8add8a7aa23 100644 --- a/detekt-generator/build.gradle.kts +++ b/detekt-generator/build.gradle.kts @@ -1,5 +1,3 @@ -import java.io.ByteArrayOutputStream - plugins { id("module") } @@ -68,16 +66,13 @@ val generateDocumentation by tasks.registering(JavaExec::class) { } val verifyGeneratorOutput by tasks.registering(Exec::class) { - notCompatibleWithConfigurationCache("cannot serialize object of type java.io.ByteArrayOutputStream") dependsOn(generateDocumentation) description = "Verifies that the default-detekt-config.yml is up-to-date" - val configDiff = ByteArrayOutputStream() - - commandLine = listOf("git", "diff", defaultConfigFile, deprecationFile) - standardOutput = configDiff + commandLine = listOf("git", "diff", "--quiet", defaultConfigFile, deprecationFile) + isIgnoreExitValue = true doLast { - if (configDiff.toString().isNotEmpty()) { + if (executionResult.get().exitValue == 1) { throw GradleException( "The default-detekt-config.yml is not up-to-date. " + "You can execute the generateDocumentation Gradle task " +