[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:
committed by
Space Team
parent
347c748182
commit
47c7dfe6b4
@@ -62,7 +62,7 @@ class BaseWriterImpl(
|
|||||||
// make sure there are no leftovers from the .def file.
|
// make sure there are no leftovers from the .def file.
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
val newValue = libraries.joinToString(" ") { it.uniqueName }
|
val newValue = libraries.map { it.uniqueName }.toSpaceSeparatedString()
|
||||||
manifestProperties.setProperty(KLIB_PROPERTY_DEPENDS, newValue)
|
manifestProperties.setProperty(KLIB_PROPERTY_DEPENDS, newValue)
|
||||||
libraries.forEach { it ->
|
libraries.forEach { it ->
|
||||||
if (it.versions.libraryVersion != null) {
|
if (it.versions.libraryVersion != null) {
|
||||||
@@ -182,4 +182,8 @@ enum class BuiltInsPlatform {
|
|||||||
companion object {
|
companion object {
|
||||||
fun parseFromString(name: String): BuiltInsPlatform? = values().firstOrNull { it.name == name }
|
fun parseFromString(name: String): BuiltInsPlatform? = values().firstOrNull { it.name == name }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun List<String>.toSpaceSeparatedString(): String = joinToString(separator = " ") {
|
||||||
|
if (it.contains(" ")) "\"$it\"" else it
|
||||||
}
|
}
|
||||||
+2
-1
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.commonizer.*
|
|||||||
import org.jetbrains.kotlin.konan.properties.propertyList
|
import org.jetbrains.kotlin.konan.properties.propertyList
|
||||||
import org.jetbrains.kotlin.library.*
|
import org.jetbrains.kotlin.library.*
|
||||||
import org.jetbrains.kotlin.library.impl.BaseWriterImpl
|
import org.jetbrains.kotlin.library.impl.BaseWriterImpl
|
||||||
|
import org.jetbrains.kotlin.library.impl.toSpaceSeparatedString
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set of properties in manifest of Kotlin/Native library that should be
|
* The set of properties in manifest of Kotlin/Native library that should be
|
||||||
@@ -53,7 +54,7 @@ fun BaseWriterImpl.addManifest(manifest: NativeSensitiveManifestData) {
|
|||||||
// Make sure all the lists are sorted for reproducible output
|
// Make sure all the lists are sorted for reproducible output
|
||||||
|
|
||||||
addOptionalProperty(KLIB_PROPERTY_DEPENDS, manifest.dependencies.isNotEmpty()) {
|
addOptionalProperty(KLIB_PROPERTY_DEPENDS, manifest.dependencies.isNotEmpty()) {
|
||||||
manifest.dependencies.sorted().joinToString(separator = " ")
|
manifest.dependencies.sorted().toSpaceSeparatedString()
|
||||||
}
|
}
|
||||||
addOptionalProperty(KLIB_PROPERTY_INTEROP, manifest.isInterop) { "true" }
|
addOptionalProperty(KLIB_PROPERTY_INTEROP, manifest.isInterop) { "true" }
|
||||||
addOptionalProperty(KLIB_PROPERTY_PACKAGE, manifest.packageFqName != null) { manifest.packageFqName!! }
|
addOptionalProperty(KLIB_PROPERTY_PACKAGE, manifest.packageFqName != null) { manifest.packageFqName!! }
|
||||||
|
|||||||
Reference in New Issue
Block a user