[CLI, Gradle] Fix GradleDeprecatedOption.removeAfter processing
The expected format was Kotlin language version (e.g. `2.0`), however the actual passed values were Kotlin release versions (e.g. `2.0.0`) ^KT-65986 In Progress
This commit is contained in:
committed by
Space Team
parent
83a9ac62ea
commit
d20f31e963
+1
-1
@@ -454,7 +454,7 @@ They should be a subset of sources passed as free arguments."""
|
||||
@GradleDeprecatedOption(
|
||||
message = "Compiler flag -Xuse-k2 is deprecated; please use language version 2.0 instead",
|
||||
level = DeprecationLevel.WARNING,
|
||||
removeAfter = "2.0.0",
|
||||
removeAfter = LanguageVersion.KOTLIN_2_0,
|
||||
)
|
||||
@GradleOption(
|
||||
DefaultValue.BOOLEAN_FALSE_DEFAULT,
|
||||
|
||||
+3
-1
@@ -5,9 +5,11 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments
|
||||
|
||||
import org.jetbrains.kotlin.config.LanguageVersion
|
||||
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class GradleDeprecatedOption(
|
||||
val message: String = "This option has no effect and will be removed in a future release.",
|
||||
val removeAfter: String,
|
||||
val removeAfter: LanguageVersion,
|
||||
val level: DeprecationLevel
|
||||
)
|
||||
+2
-2
@@ -51,7 +51,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
@GradleDeprecatedOption(
|
||||
message = "Only for legacy backend.",
|
||||
level = DeprecationLevel.WARNING,
|
||||
removeAfter = "2.0.0"
|
||||
removeAfter = LanguageVersion.KOTLIN_2_0,
|
||||
)
|
||||
@Argument(value = "-no-stdlib", description = "Don't automatically include the default Kotlin/JS stdlib in compilation dependencies.")
|
||||
var noStdlib = false
|
||||
@@ -151,7 +151,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
@GradleDeprecatedOption(
|
||||
message = "Only for legacy backend.",
|
||||
level = DeprecationLevel.WARNING,
|
||||
removeAfter = "2.0.0"
|
||||
removeAfter = LanguageVersion.KOTLIN_2_0,
|
||||
)
|
||||
@Deprecated("It is senseless to use with IR compiler. Only for compatibility.")
|
||||
@Argument(value = "-meta-info", description = "Generate .meta.js and .kjsm files with metadata. Use this to create a library.")
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.cli.common.arguments
|
||||
|
||||
import org.jetbrains.kotlin.cli.common.arguments.DevModeOverwritingStrategies.ALL
|
||||
import org.jetbrains.kotlin.cli.common.arguments.DevModeOverwritingStrategies.OLDER
|
||||
import org.jetbrains.kotlin.config.LanguageVersion
|
||||
|
||||
class K2JSDceArguments : CommonToolArguments() {
|
||||
companion object {
|
||||
@@ -21,7 +22,7 @@ class K2JSDceArguments : CommonToolArguments() {
|
||||
@GradleDeprecatedOption(
|
||||
message = "Use task 'destinationDirectory' to configure output directory",
|
||||
level = DeprecationLevel.WARNING,
|
||||
removeAfter = "1.9.0"
|
||||
removeAfter = LanguageVersion.KOTLIN_1_9,
|
||||
)
|
||||
@Argument(
|
||||
value = "-output-dir",
|
||||
|
||||
@@ -611,8 +611,7 @@ private fun generateMultiplatformCommonOptionsImpl(
|
||||
|
||||
private inline fun <reified T : Any> List<KProperty1<T, *>>.filterToBeDeleted() = filter { prop ->
|
||||
prop.findAnnotation<GradleDeprecatedOption>()
|
||||
?.let { LanguageVersion.fromVersionString(it.removeAfter) }
|
||||
?.let { it >= LanguageVersion.LATEST_STABLE }
|
||||
?.let { it.removeAfter >= LanguageVersion.LATEST_STABLE }
|
||||
?: true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user