Rename JVMPlatform and JSPlatform and make them nested in TargetPlatformKind

To avoid confusion with JvmPlatform and JsPlatform from frontend.java and
js.frontend respectively

Original commit: 26a6ce9a31
This commit is contained in:
Alexander Udalov
2016-11-10 15:59:58 +03:00
parent 036f5ae0e0
commit 1521275a5d
2 changed files with 13 additions and 13 deletions
@@ -31,8 +31,18 @@ sealed class TargetPlatformKind<out Version : DescriptionAware>(
) : DescriptionAware {
override val description = "$name ${version.description}"
class Jvm(version: JvmTarget) : TargetPlatformKind<JvmTarget>(version, "JVM") {
companion object {
val JVM_PLATFORMS by lazy { JvmTarget.values().map(::Jvm) }
operator fun get(version: JvmTarget) = JVM_PLATFORMS[version.ordinal]
}
}
object JavaScript : TargetPlatformKind<NoVersion>(NoVersion, "JavaScript")
companion object {
val ALL_PLATFORMS: List<TargetPlatformKind<*>> by lazy { JVMPlatform.JVM_PLATFORMS + JSPlatform }
val ALL_PLATFORMS: List<TargetPlatformKind<*>> by lazy { Jvm.JVM_PLATFORMS + JavaScript }
}
}
@@ -40,16 +50,6 @@ object NoVersion : DescriptionAware {
override val description = ""
}
class JVMPlatform(version: JvmTarget) : TargetPlatformKind<JvmTarget>(version, "JVM") {
companion object {
val JVM_PLATFORMS by lazy { JvmTarget.values().map(::JVMPlatform) }
operator fun get(version: JvmTarget) = JVM_PLATFORMS[version.ordinal]
}
}
object JSPlatform : TargetPlatformKind<NoVersion>(NoVersion, "JavaScript")
data class KotlinVersionInfo(
var languageLevel: LanguageVersion? = null,
var apiLevel: LanguageVersion? = null,