Move JvmTarget to frontend.java, introduce TargetPlatformVersion

Previously JvmTarget was declared in module 'util' which is accessible
for example from 'frontend', which is not very good.

Also add a superinterface named TargetPlatformVersion which is going to
be used in platform-independent injectors in 'frontend' in the following
commits. Use it in one place (LanguageVersionSettingsProviderImpl.kt)
instead of DescriptionAware because TargetPlatformVersion sounds like a
better abstraction than DescriptionAware here

Original commit: 573c6ab5d4
This commit is contained in:
Alexander Udalov
2017-03-01 19:23:14 +03:00
parent 6ea2a6540f
commit d01eed9849
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -12,5 +12,6 @@
<orderEntry type="library" name="intellij-core" level="project" /> <orderEntry type="library" name="intellij-core" level="project" />
<orderEntry type="module" module-name="cli-common" /> <orderEntry type="module" module-name="cli-common" />
<orderEntry type="module" module-name="util" /> <orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="frontend.java" />
</component> </component>
</module> </module>
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArguments import org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArguments
import org.jetbrains.kotlin.utils.DescriptionAware import org.jetbrains.kotlin.utils.DescriptionAware
sealed class TargetPlatformKind<out Version : DescriptionAware>( sealed class TargetPlatformKind<out Version : TargetPlatformVersion>(
val version: Version, val version: Version,
val name: String val name: String
) : DescriptionAware { ) : DescriptionAware {
@@ -39,9 +39,9 @@ sealed class TargetPlatformKind<out Version : DescriptionAware>(
} }
} }
object JavaScript : TargetPlatformKind<DescriptionAware.NoVersion>(DescriptionAware.NoVersion, "JavaScript") object JavaScript : TargetPlatformKind<TargetPlatformVersion.NoVersion>(TargetPlatformVersion.NoVersion, "JavaScript")
object Common : TargetPlatformKind<DescriptionAware.NoVersion>(DescriptionAware.NoVersion, "Common (experimental)") object Common : TargetPlatformKind<TargetPlatformVersion.NoVersion>(TargetPlatformVersion.NoVersion, "Common (experimental)")
companion object { companion object {
val ALL_PLATFORMS: List<TargetPlatformKind<*>> by lazy { Jvm.JVM_PLATFORMS + JavaScript + Common } val ALL_PLATFORMS: List<TargetPlatformKind<*>> by lazy { Jvm.JVM_PLATFORMS + JavaScript + Common }