Skip to content

Commit

Permalink
Make verifyGeneratorOutput task configuration cache compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed Jul 19, 2022
1 parent df219eb commit eeb6edf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions detekt-generator/build.gradle.kts
Expand Up @@ -68,16 +68,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 " +
Expand Down

0 comments on commit eeb6edf

Please sign in to comment.