From 92a695c69ccb21d0534f851b2601b77de61e9400 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Sun, 23 Mar 2025 21:19:44 +0100 Subject: [PATCH] Update CollectScreenshotsTask to handle Kotlin 2.1.20 changes Kotlin 2.1.20 altered the structure of output.classesDirs, which can no longer assume a single file. Updated the task to filter for the correct path, ensuring compatibility with the new Kotlin version. --- .../openrndr/extra/convention/kotlin-multiplatform.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts index 3de88e33..74f4e7a9 100644 --- a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts @@ -55,7 +55,8 @@ kotlin { val demo by creating { associateWith(main) tasks.register("collectScreenshots") { - inputDir.set(output.classesDirs.singleFile) + // since Kotlin 2.1.20 output.classesDirs no longer contains a single file + inputDir.set(output.classesDirs.filter { it.path.contains("classes/kotlin") }.singleFile) runtimeDependencies.set(runtimeDependencyFiles) outputDir.set(project.file(project.projectDir.toString() + "/images")) dependsOn(compileTaskProvider)