Skip to content

Commit

Permalink
HMPP. Fix tests after parameterization of NativePlatform
Browse files Browse the repository at this point in the history
  • Loading branch information
ddolovov committed Apr 14, 2020
1 parent 8d2e999 commit b108b0f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions idea/tests/org/jetbrains/kotlin/projectModel/Parser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.intellij.util.text.nullize
import org.jetbrains.kotlin.platform.CommonPlatforms
import org.jetbrains.kotlin.platform.TargetPlatform
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
import org.jetbrains.kotlin.platform.konan.NativePlatforms
import java.io.File
import java.io.InputStreamReader
import java.io.Reader
Expand Down Expand Up @@ -125,12 +126,13 @@ open class ProjectStructureParser(private val projectRoot: File) {
.toMap()

val platforms = parseRepeatableAttribute(platformString).map {
if (it == "JVM")
JvmPlatforms.defaultJvmPlatform.single()
else
platformsByPlatformName[it] ?: error(
when (it) {
"JVM" -> JvmPlatforms.defaultJvmPlatform.single()
"Native" -> NativePlatforms.unspecifiedNativePlatform.single()
else -> platformsByPlatformName[it] ?: error(
"Unknown platform $it. Available platforms: ${platformsByPlatformName.keys.joinToString()}"
)
}
}.toSet()

return TargetPlatform(platforms)
Expand Down

0 comments on commit b108b0f

Please sign in to comment.