[CHERRY PICKED FROM IJ] [jps] cleanup deprecated usages of KotlinFacetSettings.isHmppEnabled

GitOrigin-RevId: 6b20c99f5e96989c47ca3b921bd68916c8e14a89
Original commit: https://github.com/JetBrains/intellij-community/commit/6edf1a0fb3acc036f015c9263c5289f83385e9aa
This commit is contained in:
Dmitry Gridin
2021-03-30 13:39:04 +07:00
committed by Nikita Bobko
parent f3d5a71c34
commit 8f6722a1fd
2 changed files with 8 additions and 11 deletions
@@ -1,11 +1,10 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.config
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.cli.common.arguments.Argument
@@ -264,10 +263,12 @@ class KotlinFacetSettings {
var externalProjectId: String = ""
@Deprecated(message = "Use mppVersion.isHmppEnabled")
var isHmppEnabled: Boolean = false
@Deprecated(message = "Use mppVersion.isHmppEnabled", ReplaceWith("mppVersion.isHmpp"))
get
val mppVersion: KotlinMultiplatformVersion?
@Suppress("DEPRECATION")
get() = when {
isHmppEnabled -> KotlinMultiplatformVersion.M3
kind.isNewMPP -> KotlinMultiplatformVersion.M2
@@ -283,11 +284,7 @@ interface KotlinFacetSettingsProvider {
fun getInitializedSettings(module: Module): KotlinFacetSettings
companion object {
fun getInstance(project: Project): KotlinFacetSettingsProvider? {
if (project.isDisposed) {
return null
}
return ServiceManager.getService(project, KotlinFacetSettingsProvider::class.java)
}
fun getInstance(project: Project): KotlinFacetSettingsProvider? = project.takeUnless(Project::isDisposed)
?.getService(KotlinFacetSettingsProvider::class.java)
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -322,7 +322,7 @@ private fun KotlinFacetSettings.writeLatestConfig(element: Element) {
if (externalProjectId.isNotEmpty()) {
element.setAttribute("externalProjectId", externalProjectId)
}
if (isHmppEnabled) {
if (mppVersion.isHmpp) {
element.setAttribute("isHmppProject", mppVersion.isHmpp.toString())
}
if (externalSystemRunTasks.isNotEmpty()) {