From d915daf9be50dff7d94a38ebb79e1b115c6a9e6f Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Thu, 25 Jul 2024 13:18:04 +0200 Subject: [PATCH] [kotlin] enable Kotlin plugin K2 mode by default in Nightly The behavior with the `idea.kotlin.plugin.use.k2` VM option will be the following: - When no `idea.kotlin.plugin.use.k2` is specified in `.vmoptions`, it will be implicitly set to `true`. - If `idea.kotlin.plugin.use.k2` is set to `true`/`false` in `.vmoptions`, this value will be used. - If a user disables K2 mode manually in the settings, then `idea.kotlin.plugin.use.k2` will be set to `false` in `.vmoptions` and the K2 mode will be considered as disabled after a restart. ^KTIJ-30761 fixed GitOrigin-RevId: bdafaad289b4e6ad3600f0653b336aefde20874f --- .../jetbrains/intellij/build/IdeaCommunityProperties.kt | 1 + .../org/jetbrains/intellij/build/BaseIdeaProperties.kt | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/build/src/org/jetbrains/intellij/build/IdeaCommunityProperties.kt b/build/src/org/jetbrains/intellij/build/IdeaCommunityProperties.kt index 98043affde84..050d782efd98 100644 --- a/build/src/org/jetbrains/intellij/build/IdeaCommunityProperties.kt +++ b/build/src/org/jetbrains/intellij/build/IdeaCommunityProperties.kt @@ -81,6 +81,7 @@ open class IdeaCommunityProperties(private val communityHomeDir: Path) : BaseIde buildDocAuthoringAssets = true qodanaProductProperties = QodanaProductProperties("QDJVMC", "Qodana Community for JVM") + enableKotlinPluginK2ByDefault() } override suspend fun copyAdditionalFiles(context: BuildContext, targetDir: Path) { diff --git a/platform/build-scripts/src/org/jetbrains/intellij/build/BaseIdeaProperties.kt b/platform/build-scripts/src/org/jetbrains/intellij/build/BaseIdeaProperties.kt index a37c40983306..f826bc23a8d1 100644 --- a/platform/build-scripts/src/org/jetbrains/intellij/build/BaseIdeaProperties.kt +++ b/platform/build-scripts/src/org/jetbrains/intellij/build/BaseIdeaProperties.kt @@ -170,4 +170,12 @@ abstract class BaseIdeaProperties : JetBrainsProductProperties() { additionalModulesToCompile = persistentListOf("intellij.tools.jps.build.standalone") modulesToCompileTests = persistentListOf("intellij.platform.jps.build.tests") } + + /** + * 🌲 + * see KTIJ-30761 + */ + protected fun enableKotlinPluginK2ByDefault() { + additionalVmOptions += "-Didea.kotlin.plugin.use.k2=true" + } }