Change KotlinGradleSubplugin deprecation level to ERROR.
^KT-48830 Fixed
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ import org.gradle.api.Project
|
|||||||
import org.gradle.api.tasks.compile.AbstractCompile
|
import org.gradle.api.tasks.compile.AbstractCompile
|
||||||
import org.jetbrains.kotlin.gradle.plugin.*
|
import org.jetbrains.kotlin.gradle.plugin.*
|
||||||
|
|
||||||
class ExampleLegacySubplugin : @Suppress("DEPRECATION") KotlinGradleSubplugin<AbstractCompile> {
|
class ExampleLegacySubplugin : @Suppress("DEPRECATION_ERROR") KotlinGradleSubplugin<AbstractCompile> {
|
||||||
|
|
||||||
override fun isApplicable(project: Project, task: AbstractCompile): Boolean {
|
override fun isApplicable(project: Project, task: AbstractCompile): Boolean {
|
||||||
return true
|
return true
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ import javax.inject.Inject
|
|||||||
|
|
||||||
class AllOpenGradleSubplugin @Inject internal constructor(private val registry: ToolingModelBuilderRegistry) :
|
class AllOpenGradleSubplugin @Inject internal constructor(private val registry: ToolingModelBuilderRegistry) :
|
||||||
KotlinCompilerPluginSupportPlugin,
|
KotlinCompilerPluginSupportPlugin,
|
||||||
@Suppress("DEPRECATION") // implementing to fix KT-39809
|
@Suppress("DEPRECATION_ERROR") // implementing to fix KT-39809
|
||||||
KotlinGradleSubplugin<AbstractCompile> {
|
KotlinGradleSubplugin<AbstractCompile> {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
+2
-1
@@ -70,7 +70,8 @@ open class InternalSubpluginOption(key: String, value: String) : SubpluginOption
|
|||||||
message = "This interface will be removed due to performance considerations. " +
|
message = "This interface will be removed due to performance considerations. " +
|
||||||
"Please use the KotlinCompilerPluginSupportPlugin interface instead " +
|
"Please use the KotlinCompilerPluginSupportPlugin interface instead " +
|
||||||
"and remove the META-INF/services/org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin entry.",
|
"and remove the META-INF/services/org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin entry.",
|
||||||
replaceWith = ReplaceWith("KotlinCompilerPluginSupportPlugin")
|
replaceWith = ReplaceWith("KotlinCompilerPluginSupportPlugin"),
|
||||||
|
level = DeprecationLevel.ERROR
|
||||||
)
|
)
|
||||||
interface KotlinGradleSubplugin<in KotlinCompile : AbstractCompile> {
|
interface KotlinGradleSubplugin<in KotlinCompile : AbstractCompile> {
|
||||||
fun isApplicable(project: Project, task: AbstractCompile): Boolean
|
fun isApplicable(project: Project, task: AbstractCompile): Boolean
|
||||||
|
|||||||
+1
-1
@@ -839,7 +839,7 @@ private val BaseVariant.dataBindingDependencyArtifactsIfSupported: FileCollectio
|
|||||||
?.invoke(this) as? FileCollection
|
?.invoke(this) as? FileCollection
|
||||||
|
|
||||||
//region Stub implementation for legacy API, KT-39809
|
//region Stub implementation for legacy API, KT-39809
|
||||||
@Suppress("DEPRECATION") // implementing to fix KT-39809
|
@Suppress("DEPRECATION_ERROR") // implementing to fix KT-39809
|
||||||
class Kapt3KotlinGradleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
|
class Kapt3KotlinGradleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
|
||||||
override fun isApplicable(project: Project, task: AbstractCompile): Boolean = false
|
override fun isApplicable(project: Project, task: AbstractCompile): Boolean = false
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -27,7 +27,7 @@ class SubpluginEnvironment(
|
|||||||
fun loadSubplugins(project: Project): SubpluginEnvironment {
|
fun loadSubplugins(project: Project): SubpluginEnvironment {
|
||||||
val kotlinPluginVersion = project.getKotlinPluginVersion()
|
val kotlinPluginVersion = project.getKotlinPluginVersion()
|
||||||
return try {
|
return try {
|
||||||
@Suppress("DEPRECATION") // support for the deprecated plugin API
|
@Suppress("DEPRECATION_ERROR") // support for the deprecated plugin API
|
||||||
val klass = KotlinGradleSubplugin::class.java
|
val klass = KotlinGradleSubplugin::class.java
|
||||||
val buildscriptClassloader = project.buildscript.classLoader
|
val buildscriptClassloader = project.buildscript.classLoader
|
||||||
val klassFromBuildscript = try {
|
val klassFromBuildscript = try {
|
||||||
@@ -44,7 +44,7 @@ class SubpluginEnvironment(
|
|||||||
|
|
||||||
val result = project.plugins.filterIsInstance<KotlinCompilerPluginSupportPlugin>()
|
val result = project.plugins.filterIsInstance<KotlinCompilerPluginSupportPlugin>()
|
||||||
|
|
||||||
@Suppress("DEPRECATION", "UNCHECKED_CAST")
|
@Suppress("DEPRECATION_ERROR", "UNCHECKED_CAST")
|
||||||
val compatibilitySubplugins = ServiceLoader.load(klass, classloader)
|
val compatibilitySubplugins = ServiceLoader.load(klass, classloader)
|
||||||
.filter { it !is KotlinCompilerPluginSupportPlugin }
|
.filter { it !is KotlinCompilerPluginSupportPlugin }
|
||||||
.map { LegacyKotlinCompilerPluginSupportPlugin(it as KotlinGradleSubplugin<AbstractCompile>) }
|
.map { LegacyKotlinCompilerPluginSupportPlugin(it as KotlinGradleSubplugin<AbstractCompile>) }
|
||||||
@@ -139,7 +139,7 @@ internal fun addCompilationSourcesToExternalCompileTask(compilation: KotlinCompi
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal class LegacyKotlinCompilerPluginSupportPlugin(
|
internal class LegacyKotlinCompilerPluginSupportPlugin(
|
||||||
@Suppress("deprecation") // support for deprecated API
|
@Suppress("DEPRECATION_ERROR") // support for deprecated API
|
||||||
val oldPlugin: KotlinGradleSubplugin<AbstractCompile>
|
val oldPlugin: KotlinGradleSubplugin<AbstractCompile>
|
||||||
) : KotlinCompilerPluginSupportPlugin {
|
) : KotlinCompilerPluginSupportPlugin {
|
||||||
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean =
|
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean =
|
||||||
|
|||||||
+1
-1
@@ -213,7 +213,7 @@ private fun Configuration.discoverScriptExtensionsFiles() =
|
|||||||
|
|
||||||
class ScriptingKotlinGradleSubplugin :
|
class ScriptingKotlinGradleSubplugin :
|
||||||
KotlinCompilerPluginSupportPlugin,
|
KotlinCompilerPluginSupportPlugin,
|
||||||
@Suppress("DEPRECATION") // implementing to fix KT-39809
|
@Suppress("DEPRECATION_ERROR") // implementing to fix KT-39809
|
||||||
KotlinGradleSubplugin<KotlinCompile> {
|
KotlinGradleSubplugin<KotlinCompile> {
|
||||||
companion object {
|
companion object {
|
||||||
const val SCRIPTING_ARTIFACT_NAME = "kotlin-scripting-compiler-embeddable"
|
const val SCRIPTING_ARTIFACT_NAME = "kotlin-scripting-compiler-embeddable"
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ class AndroidExtensionsSubpluginIndicator @Inject internal constructor(private v
|
|||||||
|
|
||||||
class AndroidSubplugin :
|
class AndroidSubplugin :
|
||||||
KotlinCompilerPluginSupportPlugin,
|
KotlinCompilerPluginSupportPlugin,
|
||||||
@Suppress("DEPRECATION") // implementing to fix KT-39809
|
@Suppress("DEPRECATION_ERROR") // implementing to fix KT-39809
|
||||||
KotlinGradleSubplugin<AbstractCompile>
|
KotlinGradleSubplugin<AbstractCompile>
|
||||||
{
|
{
|
||||||
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean {
|
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean {
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ import javax.inject.Inject
|
|||||||
|
|
||||||
class NoArgGradleSubplugin @Inject internal constructor(private val registry: ToolingModelBuilderRegistry) :
|
class NoArgGradleSubplugin @Inject internal constructor(private val registry: ToolingModelBuilderRegistry) :
|
||||||
KotlinCompilerPluginSupportPlugin,
|
KotlinCompilerPluginSupportPlugin,
|
||||||
@Suppress("DEPRECATION") // implementing to fix KT-39809
|
@Suppress("DEPRECATION_ERROR") // implementing to fix KT-39809
|
||||||
KotlinGradleSubplugin<AbstractCompile> {
|
KotlinGradleSubplugin<AbstractCompile> {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ import javax.inject.Inject
|
|||||||
|
|
||||||
class SamWithReceiverGradleSubplugin @Inject internal constructor(private val registry: ToolingModelBuilderRegistry) :
|
class SamWithReceiverGradleSubplugin @Inject internal constructor(private val registry: ToolingModelBuilderRegistry) :
|
||||||
KotlinCompilerPluginSupportPlugin,
|
KotlinCompilerPluginSupportPlugin,
|
||||||
@Suppress("DEPRECATION") // implementing to fix KT-39809
|
@Suppress("DEPRECATION_ERROR") // implementing to fix KT-39809
|
||||||
KotlinGradleSubplugin<AbstractCompile> {
|
KotlinGradleSubplugin<AbstractCompile> {
|
||||||
|
|
||||||
override fun apply(target: Project) {
|
override fun apply(target: Project) {
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|||||||
|
|
||||||
class SerializationGradleSubplugin :
|
class SerializationGradleSubplugin :
|
||||||
KotlinCompilerPluginSupportPlugin,
|
KotlinCompilerPluginSupportPlugin,
|
||||||
@Suppress("DEPRECATION") // implementing to fix KT-39809
|
@Suppress("DEPRECATION_ERROR") // implementing to fix KT-39809
|
||||||
KotlinGradleSubplugin<AbstractCompile> {
|
KotlinGradleSubplugin<AbstractCompile> {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
Reference in New Issue
Block a user