Support progressive mode via "-progressive"
#KT-25862 Fixed
This commit is contained in:
+1
-1
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
+15
-12
@@ -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<String>? 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."
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
-5
@@ -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=<path> 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
|
||||
|
||||
Vendored
+5
@@ -23,6 +23,11 @@ where possible options include:
|
||||
-language-version <version> Provide source compatibility with specified language version
|
||||
-P plugin:<pluginId>:<optionName>=<value>
|
||||
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
|
||||
|
||||
-5
@@ -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=<path> 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
|
||||
|
||||
Vendored
+5
@@ -21,6 +21,11 @@ where possible options include:
|
||||
-language-version <version> Provide source compatibility with specified language version
|
||||
-P plugin:<pluginId>:<optionName>=<value>
|
||||
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
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
$TESTDATA_DIR$/kt19628_progressive.kt
|
||||
-Xprogressive
|
||||
-progressive
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
$TESTDATA_DIR$/progressive
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xprogressive
|
||||
-progressive
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -1467,7 +1467,7 @@ compileTestKotlin {
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = ['-Xprogressive']
|
||||
freeCompilerArgs = ['-progressive']
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
+1
-1
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ internal fun applyLanguageSettingsToKotlinTask(
|
||||
apiVersion = apiVersion ?: languageSettingsBuilder.apiVersion
|
||||
|
||||
if (languageSettingsBuilder.progressiveMode) {
|
||||
freeCompilerArgs += "-Xprogressive"
|
||||
freeCompilerArgs += "-progressive"
|
||||
}
|
||||
|
||||
languageSettingsBuilder.enabledLanguageFeatures.forEach { featureName ->
|
||||
|
||||
Reference in New Issue
Block a user