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.
This commit is contained in:
Edwin Jakobs
2025-03-23 21:19:44 +01:00
parent 51af1148f1
commit 92a695c69c

View File

@@ -55,7 +55,8 @@ kotlin {
val demo by creating { val demo by creating {
associateWith(main) associateWith(main)
tasks.register<CollectScreenshotsTask>("collectScreenshots") { tasks.register<CollectScreenshotsTask>("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) runtimeDependencies.set(runtimeDependencyFiles)
outputDir.set(project.file(project.projectDir.toString() + "/images")) outputDir.set(project.file(project.projectDir.toString() + "/images"))
dependsOn(compileTaskProvider) dependsOn(compileTaskProvider)