diff --git a/build.gradle.kts b/build.gradle.kts index 6a94d77639d..755a5373357 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -273,7 +273,7 @@ allprojects { val commonCompilerArgs = listOfNotNull( "-Xallow-kotlin-package", "-Xread-deserialized-contracts", - "-Xprogressive".takeIf { hasProperty("test.progressive.mode") }, + "-Xprogressive".takeIf { hasProperty("test.progressive.mode") }, // TODO: change to "-progressive" after bootstrap "-XXLanguage:-ReleaseCoroutines" ) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt index b675b5d682f..85b73a5a1ea 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt @@ -65,6 +65,17 @@ abstract class CommonCompilerArguments : CommonToolArguments() { ) var kotlinHome: String? by NullableStringFreezableVar(null) + @Argument( + value = "-progressive", + deprecatedName = "-Xprogressive", + description = "Enable progressive compiler mode.\n" + + "In this mode, deprecations and bug fixes for unstable code take effect immediately,\n" + + "instead of going through a graceful migration cycle.\n" + + "Code written in the progressive mode is backward compatible; however, code written in\n" + + "non-progressive mode may cause compilation errors in the progressive mode." + ) + var progressiveMode by FreezableVar(false) + @Argument(value = "-P", valueDescription = PLUGIN_OPTION_FORMAT, description = "Pass an option to a plugin") var pluginOptions: Array? by FreezableVar(null) @@ -165,16 +176,6 @@ abstract class CommonCompilerArguments : CommonToolArguments() { ) var dumpPerf: String? by NullableStringFreezableVar(null) - @Argument( - value = "-Xprogressive", - description = "Enable compiler progressive mode.\n" + - "In this mode, deprecations and bug fixes for unstable code take effect immediately,\n" + - "instead of going through graceful migration cycle.\n" + - "Code, written in progressive mode is backward compatible; however, code written in\n" + - "non-progressive mode may cause compilation errors in progressive mode." - ) - var progressiveMode by FreezableVar(false) - @Argument( value = "-Xmetadata-version", description = "Change metadata version of the generated binary files" @@ -319,8 +320,10 @@ abstract class CommonCompilerArguments : CommonToolArguments() { if (progressiveMode && languageVersion < LanguageVersion.LATEST_STABLE) { collector.report( CompilerMessageSeverity.STRONG_WARNING, - "'-Xprogressive' meaningful only for latest language version (${LanguageVersion.LATEST_STABLE}), while this build uses $languageVersion\n" + - "Behaviour of compiler in such mode is undefined; please, consider moving to the latest stable version or turning off progressive mode." + "'-progressive' is meaningful only for the latest language version (${LanguageVersion.LATEST_STABLE}), " + + "while this build uses $languageVersion\n" + + "Compiler behavior in such mode is undefined; please, consider moving to the latest stable version " + + "or turning off progressive mode." ) } diff --git a/compiler/testData/cli/js/jsExtraHelp.out b/compiler/testData/cli/js/jsExtraHelp.out index afcbfc67518..2f61b5ed2c2 100644 --- a/compiler/testData/cli/js/jsExtraHelp.out +++ b/compiler/testData/cli/js/jsExtraHelp.out @@ -19,11 +19,6 @@ where advanced options include: -Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects -Xno-inline Disable method inlining -Xplugin= Load plugins from the given classpath - -Xprogressive Enable compiler progressive mode. - In this mode, deprecations and bug fixes for unstable code take effect immediately, - instead of going through graceful migration cycle. - Code, written in progressive mode is backward compatible; however, code written in - non-progressive mode may cause compilation errors in progressive mode. -Xproper-ieee754-comparisons Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types -Xread-deserialized-contracts Enable reading of contracts from metadata -Xreport-output-files Report source to output files mapping diff --git a/compiler/testData/cli/js/jsHelp.out b/compiler/testData/cli/js/jsHelp.out index 784d0ddd2a1..af510cfa755 100644 --- a/compiler/testData/cli/js/jsHelp.out +++ b/compiler/testData/cli/js/jsHelp.out @@ -23,6 +23,11 @@ where possible options include: -language-version Provide source compatibility with specified language version -P plugin::= Pass an option to a plugin + -progressive Enable progressive compiler mode. + In this mode, deprecations and bug fixes for unstable code take effect immediately, + instead of going through a graceful migration cycle. + Code written in the progressive mode is backward compatible; however, code written in + non-progressive mode may cause compilation errors in the progressive mode. -nowarn Generate no warnings -verbose Enable verbose logging output -version Display compiler version diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 971ccf31d31..564e3d335ef 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -77,11 +77,6 @@ where advanced options include: -Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects -Xno-inline Disable method inlining -Xplugin= Load plugins from the given classpath - -Xprogressive Enable compiler progressive mode. - In this mode, deprecations and bug fixes for unstable code take effect immediately, - instead of going through graceful migration cycle. - Code, written in progressive mode is backward compatible; however, code written in - non-progressive mode may cause compilation errors in progressive mode. -Xproper-ieee754-comparisons Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types -Xread-deserialized-contracts Enable reading of contracts from metadata -Xreport-output-files Report source to output files mapping diff --git a/compiler/testData/cli/jvm/help.out b/compiler/testData/cli/jvm/help.out index ffb44ef2b2d..1c97f31e718 100644 --- a/compiler/testData/cli/jvm/help.out +++ b/compiler/testData/cli/jvm/help.out @@ -21,6 +21,11 @@ where possible options include: -language-version Provide source compatibility with specified language version -P plugin::= Pass an option to a plugin + -progressive Enable progressive compiler mode. + In this mode, deprecations and bug fixes for unstable code take effect immediately, + instead of going through a graceful migration cycle. + Code written in the progressive mode is backward compatible; however, code written in + non-progressive mode may cause compilation errors in the progressive mode. -nowarn Generate no warnings -verbose Enable verbose logging output -version Display compiler version diff --git a/compiler/testData/cli/jvm/kt19628_progressive.args b/compiler/testData/cli/jvm/kt19628_progressive.args index d45251d98ce..48e2b8f8eb2 100644 --- a/compiler/testData/cli/jvm/kt19628_progressive.args +++ b/compiler/testData/cli/jvm/kt19628_progressive.args @@ -1,2 +1,2 @@ $TESTDATA_DIR$/kt19628_progressive.kt --Xprogressive \ No newline at end of file +-progressive diff --git a/compiler/testData/cli/jvm/progressiveModeOn.args b/compiler/testData/cli/jvm/progressiveModeOn.args index d1d42e61f3e..b671b419a51 100644 --- a/compiler/testData/cli/jvm/progressiveModeOn.args +++ b/compiler/testData/cli/jvm/progressiveModeOn.args @@ -1,4 +1,4 @@ $TESTDATA_DIR$/progressive -d $TEMP_DIR$ --Xprogressive \ No newline at end of file +-progressive diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 35abcb0635f..eca963af523 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -138,7 +138,7 @@ enum class LanguageFeature( * * * # [enabledInProgressiveMode] - * If 'true', then this feature will be automatically enabled under '-Xprogressive' mode. + * If 'true', then this feature will be automatically enabled under '-progressive' mode. * * Restrictions for using this flag for particular feature follow from restrictions of the progressive mode: * - enabling it *must not* break compatibility with non-progressive compiler, i.e. code written under progressive diff --git a/idea/idea-gradle/tests/org/jetbrains/kotlin/idea/codeInsight/gradle/GradleFacetImportTest.kt b/idea/idea-gradle/tests/org/jetbrains/kotlin/idea/codeInsight/gradle/GradleFacetImportTest.kt index d6452d461bb..8712a99029a 100644 --- a/idea/idea-gradle/tests/org/jetbrains/kotlin/idea/codeInsight/gradle/GradleFacetImportTest.kt +++ b/idea/idea-gradle/tests/org/jetbrains/kotlin/idea/codeInsight/gradle/GradleFacetImportTest.kt @@ -1467,7 +1467,7 @@ compileTestKotlin { tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { - freeCompilerArgs = ['-Xprogressive'] + freeCompilerArgs = ['-progressive'] } } """ diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/NewMultiplatformIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/NewMultiplatformIT.kt index 95d2556f19b..133588955ac 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/NewMultiplatformIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/NewMultiplatformIT.kt @@ -293,7 +293,7 @@ class NewMultiplatformIT : BaseGradleIT() { build("compileKotlinJvm6") { assertSuccessful() - assertContains("-language-version 1.3", "-api-version 1.3", "-XXLanguage:+InlineClasses", " -Xprogressive") + assertContains("-language-version 1.3", "-api-version 1.3", "-XXLanguage:+InlineClasses", " -progressive") } } diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultLanguageSettingsBuilder.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultLanguageSettingsBuilder.kt index 285888e4fcb..a896e95805f 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultLanguageSettingsBuilder.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/sources/DefaultLanguageSettingsBuilder.kt @@ -62,7 +62,7 @@ internal fun applyLanguageSettingsToKotlinTask( apiVersion = apiVersion ?: languageSettingsBuilder.apiVersion if (languageSettingsBuilder.progressiveMode) { - freeCompilerArgs += "-Xprogressive" + freeCompilerArgs += "-progressive" } languageSettingsBuilder.enabledLanguageFeatures.forEach { featureName ->