Fix parser for linkerOpts/compilerOpts (KT-29970) (#2219)
This commit is contained in:
+5
-1
@@ -186,7 +186,11 @@ private fun <A : CommonToolArguments> updateField(property: KMutableProperty1<A,
|
||||
when (property.returnType.classifier) {
|
||||
Boolean::class, String::class -> property.set(result, value)
|
||||
Array<String>::class -> {
|
||||
val newElements = (value as String).split(delimiter).toTypedArray()
|
||||
val newElements = if (delimiter.isEmpty()) {
|
||||
arrayOf(value as String)
|
||||
} else {
|
||||
(value as String).split(delimiter).toTypedArray()
|
||||
}
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val oldValue = property.get(result) as Array<String>?
|
||||
property.set(result, if (oldValue != null) arrayOf(*oldValue, *newElements) else newElements)
|
||||
|
||||
Reference in New Issue
Block a user