[K/N] Update degrade script
Merge-request: KT-MR-8690 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
b262070922
commit
b61a02db73
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user