Native: Support 2- and 3-digit Kotlin/Native versions

This commit is contained in:
Dmitriy Dolovov
2019-03-07 12:59:27 +07:00
parent ec0084ef61
commit dbc66bd0ae
@@ -19,7 +19,13 @@ class LiteKonanDistributionInfoProvider(private val konanHomeDir: String) {
val versionString = stdlibInfo.compilerVersion
val version = versionString.substringBefore('-')
.split('.')
.takeIf { it.size == 3 }
.let {
when (it.size) {
2 -> listOf(it[0], it[1], "0")
3 -> it
else -> null
}
}
?.mapNotNull { it.toIntOrNull() }
?.takeIf { it.size == 3 }
?.let {