Support progressive mode via "-progressive"
#KT-25862 Fixed
This commit is contained in:
+1
-1
@@ -273,7 +273,7 @@ allprojects {
|
|||||||
val commonCompilerArgs = listOfNotNull(
|
val commonCompilerArgs = listOfNotNull(
|
||||||
"-Xallow-kotlin-package",
|
"-Xallow-kotlin-package",
|
||||||
"-Xread-deserialized-contracts",
|
"-Xread-deserialized-contracts",
|
||||||
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") },
|
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") }, // TODO: change to "-progressive" after bootstrap
|
||||||
"-XXLanguage:-ReleaseCoroutines"
|
"-XXLanguage:-ReleaseCoroutines"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+15
-12
@@ -65,6 +65,17 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
|||||||
)
|
)
|
||||||
var kotlinHome: String? by NullableStringFreezableVar(null)
|
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")
|
@Argument(value = "-P", valueDescription = PLUGIN_OPTION_FORMAT, description = "Pass an option to a plugin")
|
||||||
var pluginOptions: Array<String>? by FreezableVar(null)
|
var pluginOptions: Array<String>? by FreezableVar(null)
|
||||||
|
|
||||||
@@ -165,16 +176,6 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
|||||||
)
|
)
|
||||||
var dumpPerf: String? by NullableStringFreezableVar(null)
|
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(
|
@Argument(
|
||||||
value = "-Xmetadata-version",
|
value = "-Xmetadata-version",
|
||||||
description = "Change metadata version of the generated binary files"
|
description = "Change metadata version of the generated binary files"
|
||||||
@@ -319,8 +320,10 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
|||||||
if (progressiveMode && languageVersion < LanguageVersion.LATEST_STABLE) {
|
if (progressiveMode && languageVersion < LanguageVersion.LATEST_STABLE) {
|
||||||
collector.report(
|
collector.report(
|
||||||
CompilerMessageSeverity.STRONG_WARNING,
|
CompilerMessageSeverity.STRONG_WARNING,
|
||||||
"'-Xprogressive' meaningful only for latest language version (${LanguageVersion.LATEST_STABLE}), while this build uses $languageVersion\n" +
|
"'-progressive' is meaningful only for the latest language version (${LanguageVersion.LATEST_STABLE}), " +
|
||||||
"Behaviour of compiler in such mode is undefined; please, consider moving to the latest stable version or turning off progressive mode."
|
"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-check-actual Do not check presence of 'actual' modifier in multi-platform projects
|
||||||
-Xno-inline Disable method inlining
|
-Xno-inline Disable method inlining
|
||||||
-Xplugin=<path> Load plugins from the given classpath
|
-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
|
-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
|
-Xread-deserialized-contracts Enable reading of contracts from metadata
|
||||||
-Xreport-output-files Report source to output files mapping
|
-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
|
-language-version <version> Provide source compatibility with specified language version
|
||||||
-P plugin:<pluginId>:<optionName>=<value>
|
-P plugin:<pluginId>:<optionName>=<value>
|
||||||
Pass an option to a 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
|
-nowarn Generate no warnings
|
||||||
-verbose Enable verbose logging output
|
-verbose Enable verbose logging output
|
||||||
-version Display compiler version
|
-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-check-actual Do not check presence of 'actual' modifier in multi-platform projects
|
||||||
-Xno-inline Disable method inlining
|
-Xno-inline Disable method inlining
|
||||||
-Xplugin=<path> Load plugins from the given classpath
|
-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
|
-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
|
-Xread-deserialized-contracts Enable reading of contracts from metadata
|
||||||
-Xreport-output-files Report source to output files mapping
|
-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
|
-language-version <version> Provide source compatibility with specified language version
|
||||||
-P plugin:<pluginId>:<optionName>=<value>
|
-P plugin:<pluginId>:<optionName>=<value>
|
||||||
Pass an option to a 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
|
-nowarn Generate no warnings
|
||||||
-verbose Enable verbose logging output
|
-verbose Enable verbose logging output
|
||||||
-version Display compiler version
|
-version Display compiler version
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
$TESTDATA_DIR$/kt19628_progressive.kt
|
$TESTDATA_DIR$/kt19628_progressive.kt
|
||||||
-Xprogressive
|
-progressive
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
$TESTDATA_DIR$/progressive
|
$TESTDATA_DIR$/progressive
|
||||||
-d
|
-d
|
||||||
$TEMP_DIR$
|
$TEMP_DIR$
|
||||||
-Xprogressive
|
-progressive
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ enum class LanguageFeature(
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* # [enabledInProgressiveMode]
|
* # [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:
|
* 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
|
* - 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 {
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
freeCompilerArgs = ['-Xprogressive']
|
freeCompilerArgs = ['-progressive']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|||||||
+1
-1
@@ -293,7 +293,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
|||||||
|
|
||||||
build("compileKotlinJvm6") {
|
build("compileKotlinJvm6") {
|
||||||
assertSuccessful()
|
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
|
apiVersion = apiVersion ?: languageSettingsBuilder.apiVersion
|
||||||
|
|
||||||
if (languageSettingsBuilder.progressiveMode) {
|
if (languageSettingsBuilder.progressiveMode) {
|
||||||
freeCompilerArgs += "-Xprogressive"
|
freeCompilerArgs += "-progressive"
|
||||||
}
|
}
|
||||||
|
|
||||||
languageSettingsBuilder.enabledLanguageFeatures.forEach { featureName ->
|
languageSettingsBuilder.enabledLanguageFeatures.forEach { featureName ->
|
||||||
|
|||||||
Reference in New Issue
Block a user