Undeprecate 'kotlinOptions' DSL
'@ReplaceWith' is not that flexible in this case and proper IDE support required for smooth migration. After such migration in IDE will be added - deprecation should be restored. ^KT-54399 Fixed
This commit is contained in:
committed by
teamcity
parent
a244aaf162
commit
860d3fda95
@@ -484,8 +484,8 @@ private fun Printer.generateDeprecatedInterface(
|
||||
parentType: FqName? = null,
|
||||
) {
|
||||
val afterType = parentType?.let { " : $it" }
|
||||
// Add @Deprecated annotation back once proper migration to compilerOptions will be supported
|
||||
val modifier = """
|
||||
@Deprecated("Use ${compilerOptionType.shortName()} instead", level = DeprecationLevel.WARNING)
|
||||
interface
|
||||
""".trimIndent()
|
||||
generateDeclaration(modifier, type, afterType = afterType) {
|
||||
|
||||
-10
@@ -23,11 +23,6 @@ interface KotlinNativeArtifact : KotlinArtifact {
|
||||
val modes: Set<NativeBuildType>
|
||||
val isStatic: Boolean
|
||||
val linkerOptions: List<String>
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced by toolOptionsConfigure",
|
||||
replaceWith = ReplaceWith("toolOptionsConfigure")
|
||||
)
|
||||
val kotlinOptionsFn: KotlinCommonToolOptions.() -> Unit
|
||||
val toolOptionsConfigure: KotlinCommonCompilerToolOptions.() -> Unit
|
||||
val binaryOptions: Map<String, String>
|
||||
@@ -65,11 +60,6 @@ interface KotlinNativeArtifactConfig : KotlinArtifactConfig {
|
||||
fun modes(vararg modes: NativeBuildType)
|
||||
var isStatic: Boolean
|
||||
var linkerOptions: List<String>
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions()",
|
||||
replaceWith = ReplaceWith("toolOptions(fn)")
|
||||
)
|
||||
fun kotlinOptions(fn: Action<KotlinCommonToolOptions>)
|
||||
fun toolOptions(configure: Action<KotlinCommonCompilerToolOptions>)
|
||||
fun binaryOption(name: String, value: String)
|
||||
|
||||
-1
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
@Deprecated("Use KotlinCommonCompilerOptions instead", level = DeprecationLevel.WARNING)
|
||||
interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToolOptions {
|
||||
override val options: org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
|
||||
|
||||
|
||||
-1
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
@Deprecated("Use KotlinCommonCompilerToolOptions instead", level = DeprecationLevel.WARNING)
|
||||
interface KotlinCommonToolOptions {
|
||||
val options: org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerToolOptions
|
||||
|
||||
|
||||
-20
@@ -10,35 +10,15 @@ import org.gradle.api.Action
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.api.tasks.Internal
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced by KotlinCompilationTask",
|
||||
replaceWith = ReplaceWith(
|
||||
"KotlinCompilationTask",
|
||||
"org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask"
|
||||
)
|
||||
)
|
||||
@Suppress("DEPRECATION")
|
||||
interface KotlinCompile<out T : KotlinCommonOptions> : Task {
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced by compilerOptions input",
|
||||
replaceWith = ReplaceWith("compilerOptions")
|
||||
)
|
||||
@get:Internal
|
||||
val kotlinOptions: T
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced by compilerOptions { .. }",
|
||||
replaceWith = ReplaceWith("compilerOptions(fn)")
|
||||
)
|
||||
fun kotlinOptions(fn: T.() -> Unit) {
|
||||
kotlinOptions.fn()
|
||||
}
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced by compilerOptions(Action)",
|
||||
replaceWith = ReplaceWith("compilerOptions(fn)")
|
||||
)
|
||||
fun kotlinOptions(fn: Action<in T>) {
|
||||
fn.execute(kotlinOptions)
|
||||
}
|
||||
|
||||
-1
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
@Deprecated("Use KotlinJsDceCompilerToolOptions instead", level = DeprecationLevel.WARNING)
|
||||
interface KotlinJsDceOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToolOptions {
|
||||
override val options: org.jetbrains.kotlin.gradle.dsl.KotlinJsDceCompilerToolOptions
|
||||
|
||||
|
||||
-1
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
@Deprecated("Use KotlinJsCompilerOptions instead", level = DeprecationLevel.WARNING)
|
||||
interface KotlinJsOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions {
|
||||
override val options: org.jetbrains.kotlin.gradle.dsl.KotlinJsCompilerOptions
|
||||
|
||||
|
||||
-1
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
@Deprecated("Use KotlinJvmCompilerOptions instead", level = DeprecationLevel.WARNING)
|
||||
interface KotlinJvmOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions {
|
||||
override val options: org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
|
||||
|
||||
|
||||
-1
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
@Deprecated("Use KotlinMultiplatformCommonCompilerOptions instead", level = DeprecationLevel.WARNING)
|
||||
interface KotlinMultiplatformCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions {
|
||||
override val options: org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformCommonCompilerOptions
|
||||
}
|
||||
|
||||
-12
@@ -70,25 +70,13 @@ interface KotlinCompilation<out T : KotlinCommonOptionsDeprecated> : Named,
|
||||
|
||||
val compileTaskProvider: TaskProvider<out KotlinCompilationTask<*>>
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced by compilerOptions",
|
||||
replaceWith = ReplaceWith("compilerOptions.options")
|
||||
)
|
||||
val kotlinOptions: T
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced by compilerOptions.configure { }",
|
||||
replaceWith = ReplaceWith("compilerOptions.configure(configure)")
|
||||
)
|
||||
fun kotlinOptions(configure: T.() -> Unit) {
|
||||
@Suppress("DEPRECATION")
|
||||
configure(kotlinOptions)
|
||||
}
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced by compilerOptions(Action)",
|
||||
replaceWith = ReplaceWith("compilerOptions.configure(configure)")
|
||||
)
|
||||
fun kotlinOptions(configure: Action<@UnsafeVariance T>) {
|
||||
@Suppress("DEPRECATION")
|
||||
configure.execute(kotlinOptions)
|
||||
|
||||
-15
@@ -33,31 +33,16 @@ interface KotlinJvmCompile : KotlinJvmCompileApi
|
||||
interface KotlinCommonCompile : KotlinCompile<KotlinMultiplatformCommonOptions>
|
||||
|
||||
interface KotlinJsDce : Task {
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions",
|
||||
replaceWith = ReplaceWith("toolOptions")
|
||||
)
|
||||
@get:Internal
|
||||
val dceOptions: KotlinJsDceOptions
|
||||
|
||||
@get:Input
|
||||
val keep: MutableList<String>
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions()",
|
||||
replaceWith = ReplaceWith("toolOptions(fn)")
|
||||
)
|
||||
fun dceOptions(fn: KotlinJsDceOptions.() -> Unit) {
|
||||
dceOptions.fn()
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions()",
|
||||
replaceWith = ReplaceWith("toolOptions(fn)")
|
||||
)
|
||||
fun dceOptions(fn: Closure<*>) {
|
||||
fn.delegate = dceOptions
|
||||
fn.call()
|
||||
|
||||
+1
-15
@@ -122,35 +122,21 @@ constructor(
|
||||
@Suppress("unused", "UNCHECKED_CAST")
|
||||
@Deprecated(
|
||||
"Use toolOptions.freeCompilerArgs",
|
||||
replaceWith = ReplaceWith("toolOptions.freeCompilerArgs")
|
||||
replaceWith = ReplaceWith("toolOptions.freeCompilerArgs.get()")
|
||||
)
|
||||
@get:Internal
|
||||
val additionalCompilerOptions: Provider<Collection<String>> = toolOptions.freeCompilerArgs as Provider<Collection<String>>
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions",
|
||||
replaceWith = ReplaceWith("toolOptions")
|
||||
)
|
||||
@get:Internal
|
||||
val kotlinOptions: KotlinCommonToolOptions = object : KotlinCommonToolOptions {
|
||||
override val options: KotlinCommonCompilerToolOptions
|
||||
get() = toolOptions
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions()",
|
||||
replaceWith = ReplaceWith("toolOptions(fn)")
|
||||
)
|
||||
fun kotlinOptions(fn: KotlinCommonToolOptions.() -> Unit) {
|
||||
kotlinOptions.fn()
|
||||
}
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions()",
|
||||
replaceWith = ReplaceWith("toolOptions(fn)")
|
||||
)
|
||||
fun kotlinOptions(fn: Closure<*>) {
|
||||
@Suppress("DEPRECATION")
|
||||
fn.delegate = kotlinOptions
|
||||
|
||||
+7
-17
@@ -369,15 +369,15 @@ internal constructor(
|
||||
|
||||
// region Language settings imported from a SourceSet.
|
||||
@Deprecated(
|
||||
message = "Replaced with compilerOptions.languageVersion",
|
||||
replaceWith = ReplaceWith("compilerOptions.languageVersion")
|
||||
message = "Replaced with kotlinOptions.languageVersion",
|
||||
replaceWith = ReplaceWith("kotlinOptions.languageVersion")
|
||||
)
|
||||
val languageVersion: String?
|
||||
@Optional @Input get() = languageSettings.languageVersion
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced with compilerOptions.apiVersion",
|
||||
replaceWith = ReplaceWith("compilerOptions.apiVersion")
|
||||
message = "Replaced with kotlinOptions.apiVersion",
|
||||
replaceWith = ReplaceWith("kotlinOptions.apiVersion")
|
||||
)
|
||||
val apiVersion: String?
|
||||
@Optional @Input get() = languageSettings.apiVersion
|
||||
@@ -392,28 +392,18 @@ internal constructor(
|
||||
// region Kotlin options.
|
||||
override val compilerOptions: KotlinCommonCompilerOptions = compilation.compilerOptions.options
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced with compilerOptions",
|
||||
replaceWith = ReplaceWith("compilerOptions")
|
||||
)
|
||||
@Suppress("DEPRECATION")
|
||||
override val kotlinOptions: KotlinCommonOptions = object : KotlinCommonOptions {
|
||||
override val options: KotlinCommonCompilerOptions
|
||||
get() = compilerOptions
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with compilerOptions()",
|
||||
replaceWith = ReplaceWith("compilerOptions(fn)")
|
||||
)
|
||||
override fun kotlinOptions(fn: KotlinCommonOptions.() -> Unit) {
|
||||
kotlinOptions.fn()
|
||||
}
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced with compilerOptions()",
|
||||
replaceWith = ReplaceWith("compilerOptions(fn)")
|
||||
message = "Replaced with kotlinOptions()",
|
||||
replaceWith = ReplaceWith("kotlinOptions(fn)")
|
||||
)
|
||||
override fun kotlinOptions(fn: Closure<*>) {
|
||||
@Suppress("DEPRECATION")
|
||||
@@ -423,7 +413,7 @@ internal constructor(
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced with compilerOptions.freeCompilerArgs",
|
||||
replaceWith = ReplaceWith("compilerOptions.freeCompilerArgs")
|
||||
replaceWith = ReplaceWith("compilerOptions.freeCompilerArgs.get()")
|
||||
)
|
||||
@get:Input
|
||||
override val additionalCompilerOptions: Provider<Collection<String>>
|
||||
|
||||
-2
@@ -67,8 +67,6 @@ class KotlinNativeFatFrameworkImpl(
|
||||
override val modes: Set<NativeBuildType>,
|
||||
override val isStatic: Boolean,
|
||||
override val linkerOptions: List<String>,
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated("Replaced by toolOptionsConfigure", replaceWith = ReplaceWith("toolOptionsConfigure"))
|
||||
override val kotlinOptionsFn: KotlinCommonToolOptions.() -> Unit,
|
||||
override val toolOptionsConfigure: KotlinCommonCompilerToolOptions.() -> Unit,
|
||||
override val binaryOptions: Map<String, String>,
|
||||
|
||||
+4
-19
@@ -98,38 +98,23 @@ abstract class KotlinNativeLinkArtifactTask @Inject constructor(
|
||||
freeCompilerArgs.addAll(PropertiesProvider(project).nativeLinkArgs)
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions",
|
||||
replaceWith = ReplaceWith("toolOptions")
|
||||
)
|
||||
@get:Internal
|
||||
val kotlinOptions = object : KotlinCommonToolOptions {
|
||||
override val options: KotlinCommonCompilerToolOptions
|
||||
get() = toolOptions
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions()",
|
||||
replaceWith = ReplaceWith("toolOptions(fn)")
|
||||
)
|
||||
fun kotlinOptions(fn: KotlinCommonToolOptions.() -> Unit) {
|
||||
kotlinOptions.fn()
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions()",
|
||||
replaceWith = ReplaceWith("toolOptions(fn)")
|
||||
)
|
||||
fun kotlinOptions(fn: Action<KotlinCommonToolOptions>) {
|
||||
fn.execute(kotlinOptions)
|
||||
}
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions.allWarningsAsErrors",
|
||||
replaceWith = ReplaceWith("toolOptions.allWarningsAsErrors")
|
||||
replaceWith = ReplaceWith("toolOptions.allWarningsAsErrors.get()")
|
||||
)
|
||||
@get:Internal
|
||||
val allWarningsAsErrors: Boolean
|
||||
@@ -137,7 +122,7 @@ abstract class KotlinNativeLinkArtifactTask @Inject constructor(
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions.suppressWarnings",
|
||||
replaceWith = ReplaceWith("toolOptions.suppressWarnings")
|
||||
replaceWith = ReplaceWith("toolOptions.suppressWarnings.get()")
|
||||
)
|
||||
@get:Internal
|
||||
val suppressWarnings: Boolean
|
||||
@@ -145,7 +130,7 @@ abstract class KotlinNativeLinkArtifactTask @Inject constructor(
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions.verbose",
|
||||
replaceWith = ReplaceWith("toolOptions.verbose")
|
||||
replaceWith = ReplaceWith("toolOptions.verbose.get()")
|
||||
)
|
||||
@get:Internal
|
||||
val verbose: Boolean
|
||||
@@ -153,7 +138,7 @@ abstract class KotlinNativeLinkArtifactTask @Inject constructor(
|
||||
|
||||
@Deprecated(
|
||||
message = "Replaced with toolOptions.freeCompilerArgs",
|
||||
replaceWith = ReplaceWith("toolOptions.freeCompilerArgs")
|
||||
replaceWith = ReplaceWith("toolOptions.freeCompilerArgs.get()")
|
||||
)
|
||||
@get:Internal
|
||||
val freeCompilerArgs: List<String>
|
||||
|
||||
-2
@@ -67,8 +67,6 @@ class KotlinNativeXCFrameworkImpl(
|
||||
override val modes: Set<NativeBuildType>,
|
||||
override val isStatic: Boolean,
|
||||
override val linkerOptions: List<String>,
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated("Replaced by toolOptionsConfigure", replaceWith = ReplaceWith("toolOptionsConfigure"))
|
||||
override val kotlinOptionsFn: KotlinCommonToolOptions.() -> Unit,
|
||||
override val toolOptionsConfigure: KotlinCommonCompilerToolOptions.() -> Unit,
|
||||
override val binaryOptions: Map<String, String>,
|
||||
|
||||
-2
@@ -46,8 +46,6 @@ abstract class KotlinCompileCommon @Inject constructor(
|
||||
compilerOptions.verbose.convention(logger.isDebugEnabled)
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated("Replaced by compilerOptions input", replaceWith = ReplaceWith("compilerOptions"))
|
||||
override val kotlinOptions: KotlinMultiplatformCommonOptions = KotlinMultiplatformCommonOptionsCompat(
|
||||
{ this },
|
||||
compilerOptions
|
||||
|
||||
-2
@@ -66,8 +66,6 @@ abstract class KotlinJsDce @Inject constructor(
|
||||
@Internal
|
||||
var kotlinFilesOnly: Boolean = false
|
||||
|
||||
@Deprecated("Replaced with toolOptions", replaceWith = ReplaceWith("toolOptions"))
|
||||
@Suppress("DEPRECATION")
|
||||
@get:Internal
|
||||
override val dceOptions: KotlinJsDceOptions = object : KotlinJsDceOptions {
|
||||
override val options: KotlinJsDceCompilerToolOptions
|
||||
|
||||
-4
@@ -552,8 +552,6 @@ abstract class KotlinCompile @Inject constructor(
|
||||
compilerOptions.verbose.convention(logger.isDebugEnabled)
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated("Replaced by compilerOptions input", replaceWith = ReplaceWith("compilerOptions"))
|
||||
final override val kotlinOptions: KotlinJvmOptions = KotlinJvmOptionsCompat(
|
||||
{ this },
|
||||
compilerOptions
|
||||
@@ -953,8 +951,6 @@ abstract class Kotlin2JsCompile @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated("Replaced by compilerOptions input", replaceWith = ReplaceWith("compilerOptions"))
|
||||
override val kotlinOptions: KotlinJsOptions = KotlinJsOptionsCompat(
|
||||
{ this },
|
||||
compilerOptions
|
||||
|
||||
Reference in New Issue
Block a user