Introduce unspecifiedJvmPlatform for clients without jvmTarget

Previously, a lot of clients used JvmPlatform as platform-marker,
without thinking about jvmTarget.

For the sake of migration, this commits introduced so-called
UnspecifiedJvmPlatform, which can be used for a time being, but
generally, all usages should be removed in  future.
This commit is contained in:
Dmitry Savvinov
2019-05-23 18:31:42 +03:00
parent ef39e2a68f
commit 8997fa52df
41 changed files with 57 additions and 57 deletions
@@ -71,7 +71,7 @@ open class KotlinJavaModuleConfigurator protected constructor() : KotlinWithLibr
get() = NAME
override val targetPlatform: TargetPlatform
get() = JvmPlatforms.defaultJvmPlatform
get() = JvmPlatforms.unspecifiedJvmPlatform
@Suppress("DEPRECATION_ERROR")
override fun getTargetPlatform() = JvmPlatforms.CompatJvmPlatform
@@ -179,7 +179,7 @@ private object DebugLabelModuleDescriptor
}
override val platform: TargetPlatform?
get() = JvmPlatforms.defaultJvmPlatform
get() = JvmPlatforms.unspecifiedJvmPlatform
override fun getSubPackagesOf(fqName: FqName, nameFilter: (Name) -> Boolean): Collection<FqName> {
return emptyList()
@@ -41,7 +41,7 @@ class KotlinTemplatesFactory : ProjectTemplatesFactory() {
val result = mutableListOf<ProjectTemplate>(
BuilderBasedTemplate(
KotlinModuleBuilder(
JvmPlatforms.defaultJvmPlatform,
JvmPlatforms.unspecifiedJvmPlatform,
"JVM | IDEA",
"Kotlin project with a JVM target based on the IntelliJ IDEA build system",
KotlinIcons.SMALL_LOGO
@@ -286,7 +286,7 @@ class KotlinBytecodeToolWindow(private val myProject: Project, private val toolW
if (!platform.isCommon() && !platform.isJvm()) return null
val resolutionFacade = KotlinCacheService.getInstance(ktFile.project)
.getResolutionFacadeByFile(ktFile, JvmPlatforms.defaultJvmPlatform)
.getResolutionFacadeByFile(ktFile, JvmPlatforms.unspecifiedJvmPlatform)
?: return null
val bindingContextForFile = resolutionFacade.analyzeWithAllCompilerChecks(listOf(ktFile)).bindingContext