Skip to content

Commit

Permalink
Add NATIVE and JS producer types in IJ (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
raniejade authored May 21, 2019
1 parent b285a69 commit abb434b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@ package org.spekframework.intellij

import org.jetbrains.kotlin.platform.IdePlatformKind
import org.jetbrains.kotlin.platform.impl.CommonIdePlatformKind
import org.jetbrains.kotlin.platform.impl.JsIdePlatformKind
import org.jetbrains.kotlin.platform.impl.JvmIdePlatformKind
import org.jetbrains.kotlin.platform.impl.NativeIdePlatformKind

enum class ProducerType {
COMMON,
JVM
JVM,
NATIVE,
JS
}

fun IdePlatformKind<*>.toProducerType(): ProducerType {
return when (this) {
CommonIdePlatformKind -> ProducerType.COMMON
JvmIdePlatformKind -> ProducerType.JVM
NativeIdePlatformKind -> ProducerType.NATIVE
JsIdePlatformKind -> ProducerType.JS
else -> throw IllegalArgumentException("Unsupported platform kind: ${this}")
}
}

0 comments on commit abb434b

Please sign in to comment.