Deprecate 'kotlin.coroutines' property and extension
Deprecation 'kotlin.coroutines' property and related 'kotlin.experimental.coroutines' extension DSL. These properties are not doing anything since 1.5.0 release and has to be removed long time ago. ^KT-50369 Fixed
This commit is contained in:
+16
-2
@@ -23,16 +23,18 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl
|
|||||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrSingleTargetPreset
|
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrSingleTargetPreset
|
||||||
import org.jetbrains.kotlin.gradle.tasks.CompileUsingKotlinDaemon
|
import org.jetbrains.kotlin.gradle.tasks.CompileUsingKotlinDaemon
|
||||||
import org.jetbrains.kotlin.gradle.tasks.withType
|
import org.jetbrains.kotlin.gradle.tasks.withType
|
||||||
|
import org.jetbrains.kotlin.gradle.utils.SingleWarningPerBuild
|
||||||
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
||||||
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
||||||
import org.jetbrains.kotlin.statistics.metrics.StringMetrics
|
import org.jetbrains.kotlin.statistics.metrics.StringMetrics
|
||||||
|
import javax.inject.Inject
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
private const val KOTLIN_PROJECT_EXTENSION_NAME = "kotlin"
|
private const val KOTLIN_PROJECT_EXTENSION_NAME = "kotlin"
|
||||||
|
|
||||||
internal fun Project.createKotlinExtension(extensionClass: KClass<out KotlinTopLevelExtension>): KotlinTopLevelExtension {
|
internal fun Project.createKotlinExtension(extensionClass: KClass<out KotlinTopLevelExtension>): KotlinTopLevelExtension {
|
||||||
val kotlinExt = extensions.create(KOTLIN_PROJECT_EXTENSION_NAME, extensionClass.java, this)
|
val kotlinExt = extensions.create(KOTLIN_PROJECT_EXTENSION_NAME, extensionClass.java, this)
|
||||||
DslObject(kotlinExt).extensions.create("experimental", ExperimentalExtension::class.java)
|
DslObject(kotlinExt).extensions.create("experimental", ExperimentalExtension::class.java, this)
|
||||||
return topLevelExtension
|
return topLevelExtension
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,8 +288,20 @@ open class KotlinAndroidProjectExtension(project: Project) : KotlinSingleTargetE
|
|||||||
open fun target(body: KotlinAndroidTarget.() -> Unit) = target.run(body)
|
open fun target(body: KotlinAndroidTarget.() -> Unit) = target.run(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
open class ExperimentalExtension {
|
open class ExperimentalExtension @Inject constructor(
|
||||||
|
private val project: Project
|
||||||
|
) {
|
||||||
var coroutines: Coroutines? = null
|
var coroutines: Coroutines? = null
|
||||||
|
set(value) {
|
||||||
|
SingleWarningPerBuild.show(
|
||||||
|
project,
|
||||||
|
"""
|
||||||
|
'kotlin.experimental.coroutines' option does nothing since 1.5.0 release
|
||||||
|
and scheduled to be removed in Kotlin 1.7.0 release!
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
field = value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class Coroutines {
|
enum class Coroutines {
|
||||||
|
|||||||
+13
-1
@@ -75,7 +75,19 @@ internal class PropertiesProvider private constructor(private val project: Proje
|
|||||||
}
|
}
|
||||||
|
|
||||||
val coroutines: Coroutines?
|
val coroutines: Coroutines?
|
||||||
get() = property("kotlin.coroutines")?.let { Coroutines.byCompilerArgument(it) }
|
get() {
|
||||||
|
val propValue = property("kotlin.coroutines")?.let { Coroutines.byCompilerArgument(it) }
|
||||||
|
if (propValue != null) {
|
||||||
|
SingleWarningPerBuild.show(
|
||||||
|
project,
|
||||||
|
"""
|
||||||
|
'kotlin.coroutines' property does nothing since 1.5.0 release
|
||||||
|
and scheduled to be removed in Kotlin 1.7.0 release!
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return propValue
|
||||||
|
}
|
||||||
|
|
||||||
val singleBuildMetricsFile: File?
|
val singleBuildMetricsFile: File?
|
||||||
get() = property("kotlin.internal.single.build.metrics.file")?.let { File(it) }
|
get() = property("kotlin.internal.single.build.metrics.file")?.let { File(it) }
|
||||||
|
|||||||
Reference in New Issue
Block a user