From f6963d04e900a9a6575da5495be27ef4fcfb4973 Mon Sep 17 00:00:00 2001 From: "Aleksei.Cherepanov" Date: Tue, 25 Jul 2023 17:59:47 +0200 Subject: [PATCH] Run K1 configuration on TC with languageVersion="1.9" KotlinVersion is overrided on TC, so we need to rely on LanguageVersion #KT-60589 Fixed --- .../kotlin/jps/build/AbstractIncrementalK1JvmJpsTest.kt | 3 ++- .../build/AbstractIncrementalK2FirICLightTreeJvmJpsTest.kt | 3 ++- .../kotlin/jps/build/AbstractIncrementalK2JvmJpsTest.kt | 3 ++- .../jps/build/AbstractIncrementalK2LightTreeJvmJpsTest.kt | 3 ++- .../blackboxtest/support/settings/TestProcessSettings.kt | 6 ++---- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK1JvmJpsTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK1JvmJpsTest.kt index 8f6bf1644fc..308d2861a72 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK1JvmJpsTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK1JvmJpsTest.kt @@ -6,12 +6,13 @@ package org.jetbrains.kotlin.jps.build import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments +import org.jetbrains.kotlin.config.LanguageVersion abstract class AbstractIncrementalK1JvmJpsTest( allowNoFilesWithSuffixInTestData: Boolean = false ) : AbstractIncrementalJvmJpsTest(allowNoFilesWithSuffixInTestData = allowNoFilesWithSuffixInTestData) { override fun updateCommandLineArguments(arguments: CommonCompilerArguments) { - if (KotlinVersion.CURRENT.major >= 2) { + if (LanguageVersion.LATEST_STABLE.major >= 2) { arguments.languageVersion = "1.9" } super.updateCommandLineArguments(arguments) diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2FirICLightTreeJvmJpsTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2FirICLightTreeJvmJpsTest.kt index ee77fb96be5..34233fb8dea 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2FirICLightTreeJvmJpsTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2FirICLightTreeJvmJpsTest.kt @@ -6,13 +6,14 @@ package org.jetbrains.kotlin.jps.build import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments +import org.jetbrains.kotlin.config.LanguageVersion import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder abstract class AbstractIncrementalK2FirICLightTreeJvmJpsTest( allowNoFilesWithSuffixInTestData: Boolean = false ) : AbstractIncrementalJpsTest(allowNoFilesWithSuffixInTestData = allowNoFilesWithSuffixInTestData) { override fun updateCommandLineArguments(arguments: CommonCompilerArguments) { - if (KotlinVersion.CURRENT.major < 2) { + if (LanguageVersion.LATEST_STABLE.major < 2) { arguments.languageVersion = "2.0" } additionalCommandLineArguments = additionalCommandLineArguments + listOf("-Xuse-fir-ic", "-Xuse-fir-lt") diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2JvmJpsTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2JvmJpsTest.kt index e9dcb2850ee..69156460a85 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2JvmJpsTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2JvmJpsTest.kt @@ -6,13 +6,14 @@ package org.jetbrains.kotlin.jps.build import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments +import org.jetbrains.kotlin.config.LanguageVersion import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder abstract class AbstractIncrementalK2JvmJpsTest( allowNoFilesWithSuffixInTestData: Boolean = false ) : AbstractIncrementalJpsTest(allowNoFilesWithSuffixInTestData = allowNoFilesWithSuffixInTestData) { override fun updateCommandLineArguments(arguments: CommonCompilerArguments) { - if (KotlinVersion.CURRENT.major < 2) { + if (LanguageVersion.LATEST_STABLE.major < 2) { arguments.languageVersion = "2.0" } additionalCommandLineArguments = additionalCommandLineArguments + listOf("-Xuse-fir-lt=false") diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2LightTreeJvmJpsTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2LightTreeJvmJpsTest.kt index 21403220521..0661dd67989 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2LightTreeJvmJpsTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2LightTreeJvmJpsTest.kt @@ -6,13 +6,14 @@ package org.jetbrains.kotlin.jps.build import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments +import org.jetbrains.kotlin.config.LanguageVersion import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder abstract class AbstractIncrementalK2LightTreeJvmJpsTest( allowNoFilesWithSuffixInTestData: Boolean = false ) : AbstractIncrementalJpsTest(allowNoFilesWithSuffixInTestData = allowNoFilesWithSuffixInTestData) { override fun updateCommandLineArguments(arguments: CommonCompilerArguments) { - if (KotlinVersion.CURRENT.major < 2) { + if (LanguageVersion.LATEST_STABLE.major < 2) { arguments.languageVersion = "2.0" } additionalCommandLineArguments = additionalCommandLineArguments + listOf("-Xuse-fir-lt=true") diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/settings/TestProcessSettings.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/settings/TestProcessSettings.kt index 9afc961dcf7..2e810ba377c 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/settings/TestProcessSettings.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/settings/TestProcessSettings.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.konan.blackboxtest.support.settings +import org.jetbrains.kotlin.config.LanguageVersion import org.jetbrains.kotlin.konan.blackboxtest.support.MutedOption import org.jetbrains.kotlin.konan.blackboxtest.support.TestKind import org.jetbrains.kotlin.konan.blackboxtest.support.runner.LocalTestRunner @@ -259,9 +260,6 @@ internal sealed class CacheMode { } } -private fun KotlinVersion.toCanonicalString(): String = - "$major.$minor" - internal enum class PipelineType(val mutedOption: MutedOption, val compilerFlags: List) { K1( MutedOption.K1, @@ -269,7 +267,7 @@ internal enum class PipelineType(val mutedOption: MutedOption, val compilerFlags ), K2( MutedOption.K2, - listOf("-language-version", if (KotlinVersion.CURRENT.major < 2) "2.0" else KotlinVersion.CURRENT.toCanonicalString()) + listOf("-language-version", if (LanguageVersion.LATEST_STABLE.major < 2) "2.0" else LanguageVersion.LATEST_STABLE.toString()) ); override fun toString() = if (compilerFlags.isEmpty()) "" else compilerFlags.joinToString(prefix = "(", postfix = ")", separator = " ")