[K/N][klib] Wrap library dependencies with quotation marks

Fixes ^KT-58537. Space in the library now should be correctly parsed now
Klib readers can already read this
This commit is contained in:
Pavel Punegov
2023-05-25 14:59:13 +02:00
committed by Space Team
parent 347c748182
commit 47c7dfe6b4
2 changed files with 7 additions and 2 deletions
@@ -62,7 +62,7 @@ class BaseWriterImpl(
// make sure there are no leftovers from the .def file.
return
} else {
val newValue = libraries.joinToString(" ") { it.uniqueName }
val newValue = libraries.map { it.uniqueName }.toSpaceSeparatedString()
manifestProperties.setProperty(KLIB_PROPERTY_DEPENDS, newValue)
libraries.forEach { it ->
if (it.versions.libraryVersion != null) {
@@ -182,4 +182,8 @@ enum class BuiltInsPlatform {
companion object {
fun parseFromString(name: String): BuiltInsPlatform? = values().firstOrNull { it.name == name }
}
}
fun List<String>.toSpaceSeparatedString(): String = joinToString(separator = " ") {
if (it.contains(" ")) "\"$it\"" else it
}