Rename JVMPlatform and JSPlatform and make them nested in TargetPlatformKind
To avoid confusion with JvmPlatform and JsPlatform from frontend.java and js.frontend respectively
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user