Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make verifyGeneratorOutput task configuration cache compatible #5100

Merged
merged 1 commit into from Jul 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 3 additions & 8 deletions detekt-generator/build.gradle.kts
@@ -1,5 +1,3 @@
import java.io.ByteArrayOutputStream

plugins {
id("module")
}
Expand Down Expand Up @@ -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 " +
Expand Down