diff --git a/kotlin-native/tools/degrade/README.md b/kotlin-native/tools/degrade/README.md index 3709a291028..5a6e18fdef4 100644 --- a/kotlin-native/tools/degrade/README.md +++ b/kotlin-native/tools/degrade/README.md @@ -7,7 +7,7 @@ without Gradle. Intended to be helpful in minimizing reproducers or investigating Kotlin/Native-related problems. -Confirmed to work with Kotlin versions from 1.5.10 to 1.6.0-M1. +Confirmed to work with Kotlin versions from 1.8.10 to 1.9.0-Beta Probably doesn't work on Windows. ## Usage diff --git a/kotlin-native/tools/degrade/degrade.init.gradle.kts b/kotlin-native/tools/degrade/degrade.init.gradle.kts index 6175f10fc14..b94e2aebbcd 100644 --- a/kotlin-native/tools/degrade/degrade.init.gradle.kts +++ b/kotlin-native/tools/degrade/degrade.init.gradle.kts @@ -77,7 +77,7 @@ private class Degrade(val rootProject: Project) { if (commands.isEmpty()) return null - val konanHome = project.properties["konanHome"] + val konanHome = project.properties["konanHome"] ?: project.properties["kotlinNativeDist"] val scriptName = task.path.substring(1).replace(':', '_') + ".sh" @@ -116,7 +116,16 @@ private class Degrade(val rootProject: Project) { val transformedArguments = generateSequence(nextLine) .takeWhile { it != "]" } - .map { it.trimStart() } + .flatMap { + val line = it.trimStart() + if (line.startsWith("@")) { // argument with filename containing list of arguments + File(line.substringAfter("@")) + .readText() + .split("\n") + .map { it.substringAfter('"').substringBeforeLast('"') } + } else + listOf(line) + } .toList() result += KotlinNativeCommand(transformedArguments)