diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt index e96a3b1073f..db9aecf9022 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt @@ -768,4 +768,39 @@ class KotlinGradleIT : KGPBaseTest() { build(":consumer:aggregate") } } + + @Disabled + @DisplayName("KT-61273: task output backup works correctly if the first output is absent") + @GradleTest + fun taskOutputBackupWorksIfFirstOutputIsAbsent(gradleVersion: GradleVersion) { + project("kotlinProject", gradleVersion) { + buildGradle.append( + //language=Gradle + """ + tasks.named("compileKotlin", org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configure { + Provider dir = project.layout.buildDirectory.dir(".a") // name it that's way so it will be the first output in an ordered set + outputs.dir(dir) + doFirst { + dir.get().getAsFile().delete() + } + } + """.trimIndent() + ) + + build("compileKotlin") { + assertTasksExecuted(":compileKotlin") + } + + kotlinSourcesDir().resolve("Dummy.kt").append( + """ + fun foo() {} + """.trimIndent() + ) + + + build("compileKotlin") { + assertTasksExecuted(":compileKotlin") + } + } + } }