[Gradle] Remove deprecated experimental annotation methods & properties
#KT-47763 Fixed
This commit is contained in:
committed by
Space
parent
0bf6f1eb83
commit
aba495f63c
-6
@@ -18,11 +18,5 @@ interface LanguageSettingsBuilder : LanguageSettings {
|
|||||||
|
|
||||||
override val enabledLanguageFeatures: Set<String>
|
override val enabledLanguageFeatures: Set<String>
|
||||||
|
|
||||||
@Deprecated("Unsupported and will be removed in next major releases", replaceWith = ReplaceWith("optIn(name)"))
|
|
||||||
fun useExperimentalAnnotation(name: String)
|
|
||||||
|
|
||||||
fun optIn(annotationName: String)
|
fun optIn(annotationName: String)
|
||||||
|
|
||||||
@Deprecated("Unsupported and will be removed in next major releases", replaceWith = ReplaceWith("optInAnnotationsInUse"))
|
|
||||||
override val experimentalAnnotationsInUse: Set<String>
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -165,7 +165,7 @@ class GradleProjectModuleBuilder(private val addInferredSourceSetVisibilityAsExp
|
|||||||
?: listOf(compilation.defaultSourceSetName)
|
?: listOf(compilation.defaultSourceSetName)
|
||||||
|
|
||||||
variantNames.forEach { variantName ->
|
variantNames.forEach { variantName ->
|
||||||
val variant = BasicKotlinModuleVariant(this@apply, variantName, DefaultLanguageSettingsBuilder(project))
|
val variant = BasicKotlinModuleVariant(this@apply, variantName, DefaultLanguageSettingsBuilder())
|
||||||
moduleByFragment[variant] = this@apply
|
moduleByFragment[variant] = this@apply
|
||||||
variantToCompilation[variant] = compilation
|
variantToCompilation[variant] = compilation
|
||||||
fragments.add(variant)
|
fragments.add(variant)
|
||||||
|
|||||||
-1
@@ -50,7 +50,6 @@ class GradleKotlinDependencyGraphResolver(
|
|||||||
?: buildSyntheticPlainModule(
|
?: buildSyntheticPlainModule(
|
||||||
component,
|
component,
|
||||||
component.variants.singleOrNull()?.displayName ?: "default",
|
component.variants.singleOrNull()?.displayName ?: "default",
|
||||||
requestingModule.project
|
|
||||||
)
|
)
|
||||||
|
|
||||||
fun nodeFromModule(componentResult: ResolvedComponentResult, kotlinModule: KotlinModule): GradleDependencyGraphNode {
|
fun nodeFromModule(componentResult: ResolvedComponentResult, kotlinModule: KotlinModule): GradleDependencyGraphNode {
|
||||||
|
|||||||
+1
-2
@@ -116,11 +116,10 @@ class GradleModuleDependencyResolver(
|
|||||||
internal fun buildSyntheticPlainModule(
|
internal fun buildSyntheticPlainModule(
|
||||||
resolvedComponentResult: ResolvedComponentResult,
|
resolvedComponentResult: ResolvedComponentResult,
|
||||||
singleVariantName: String,
|
singleVariantName: String,
|
||||||
project: Project
|
|
||||||
): ExternalPlainKotlinModule {
|
): ExternalPlainKotlinModule {
|
||||||
val moduleDependency = resolvedComponentResult.toModuleDependency()
|
val moduleDependency = resolvedComponentResult.toModuleDependency()
|
||||||
return ExternalPlainKotlinModule(BasicKotlinModule(moduleDependency.moduleIdentifier).apply {
|
return ExternalPlainKotlinModule(BasicKotlinModule(moduleDependency.moduleIdentifier).apply {
|
||||||
BasicKotlinModuleVariant(this@apply, singleVariantName, DefaultLanguageSettingsBuilder(project)).apply {
|
BasicKotlinModuleVariant(this@apply, singleVariantName, DefaultLanguageSettingsBuilder()).apply {
|
||||||
fragments.add(this)
|
fragments.add(this)
|
||||||
this.declaredModuleDependencies.addAll(
|
this.declaredModuleDependencies.addAll(
|
||||||
resolvedComponentResult.dependencies
|
resolvedComponentResult.dependencies
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ open class KotlinGradleFragmentInternal @Inject constructor(
|
|||||||
// TODO pull up to KotlinModuleFragment
|
// TODO pull up to KotlinModuleFragment
|
||||||
// FIXME apply to compilation
|
// FIXME apply to compilation
|
||||||
// FIXME check for consistency
|
// FIXME check for consistency
|
||||||
override val languageSettings: LanguageSettingsBuilder = DefaultLanguageSettingsBuilder(project)
|
override val languageSettings: LanguageSettingsBuilder = DefaultLanguageSettingsBuilder()
|
||||||
|
|
||||||
override fun refines(other: KotlinGradleFragment) {
|
override fun refines(other: KotlinGradleFragment) {
|
||||||
checkCanRefine(other)
|
checkCanRefine(other)
|
||||||
|
|||||||
+1
-1
@@ -64,7 +64,7 @@ class DefaultKotlinSourceSet(
|
|||||||
filter.include("**/*.kts")
|
filter.include("**/*.kts")
|
||||||
}
|
}
|
||||||
|
|
||||||
override val languageSettings: LanguageSettingsBuilder = DefaultLanguageSettingsBuilder(project)
|
override val languageSettings: LanguageSettingsBuilder = DefaultLanguageSettingsBuilder()
|
||||||
|
|
||||||
override val resources: SourceDirectorySet = createDefaultSourceDirectorySet(project, "$name resources")
|
override val resources: SourceDirectorySet = createDefaultSourceDirectorySet(project, "$name resources")
|
||||||
|
|
||||||
|
|||||||
+1
-24
@@ -6,7 +6,6 @@
|
|||||||
package org.jetbrains.kotlin.gradle.plugin.sources
|
package org.jetbrains.kotlin.gradle.plugin.sources
|
||||||
|
|
||||||
import org.gradle.api.InvalidUserDataException
|
import org.gradle.api.InvalidUserDataException
|
||||||
import org.gradle.api.Project
|
|
||||||
import org.gradle.api.file.FileCollection
|
import org.gradle.api.file.FileCollection
|
||||||
import org.gradle.api.provider.Provider
|
import org.gradle.api.provider.Provider
|
||||||
import org.gradle.api.tasks.SourceTask
|
import org.gradle.api.tasks.SourceTask
|
||||||
@@ -18,12 +17,11 @@ import org.jetbrains.kotlin.gradle.plugin.LanguageSettingsBuilder
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.statistics.KotlinBuildStatsService
|
import org.jetbrains.kotlin.gradle.plugin.statistics.KotlinBuildStatsService
|
||||||
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
||||||
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinNativeCompile
|
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinNativeCompile
|
||||||
import org.jetbrains.kotlin.gradle.utils.SingleWarningPerBuild
|
|
||||||
import org.jetbrains.kotlin.project.model.LanguageSettings
|
import org.jetbrains.kotlin.project.model.LanguageSettings
|
||||||
import org.jetbrains.kotlin.statistics.metrics.BooleanMetrics
|
import org.jetbrains.kotlin.statistics.metrics.BooleanMetrics
|
||||||
import org.jetbrains.kotlin.statistics.metrics.StringMetrics
|
import org.jetbrains.kotlin.statistics.metrics.StringMetrics
|
||||||
|
|
||||||
internal class DefaultLanguageSettingsBuilder(@Transient private val project: Project) : LanguageSettingsBuilder {
|
internal class DefaultLanguageSettingsBuilder : LanguageSettingsBuilder {
|
||||||
private var languageVersionImpl: LanguageVersion? = null
|
private var languageVersionImpl: LanguageVersion? = null
|
||||||
|
|
||||||
override var languageVersion: String?
|
override var languageVersion: String?
|
||||||
@@ -66,31 +64,10 @@ internal class DefaultLanguageSettingsBuilder(@Transient private val project: Pr
|
|||||||
|
|
||||||
override val optInAnnotationsInUse: Set<String> = optInAnnotationsInUseImpl
|
override val optInAnnotationsInUse: Set<String> = optInAnnotationsInUseImpl
|
||||||
|
|
||||||
override val experimentalAnnotationsInUse: Set<String>
|
|
||||||
get() {
|
|
||||||
SingleWarningPerBuild.deprecation(
|
|
||||||
project,
|
|
||||||
"Kotlin language settings property",
|
|
||||||
"experimentalAnnotationsInUse",
|
|
||||||
"optInAnnotationsInUse"
|
|
||||||
)
|
|
||||||
return optInAnnotationsInUse
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun optIn(annotationName: String) {
|
override fun optIn(annotationName: String) {
|
||||||
optInAnnotationsInUseImpl += annotationName
|
optInAnnotationsInUseImpl += annotationName
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun useExperimentalAnnotation(name: String) {
|
|
||||||
SingleWarningPerBuild.deprecation(
|
|
||||||
project,
|
|
||||||
"Kotlin language settings function",
|
|
||||||
"useExperimentalAnnotation",
|
|
||||||
"optIn"
|
|
||||||
)
|
|
||||||
optIn(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
/* A Kotlin task that is responsible for code analysis of the owner of this language settings builder. */
|
/* A Kotlin task that is responsible for code analysis of the owner of this language settings builder. */
|
||||||
@Transient // not needed during Gradle Instant Execution
|
@Transient // not needed during Gradle Instant Execution
|
||||||
var compilerPluginOptionsTask: Lazy<SourceTask?> = lazyOf(null)
|
var compilerPluginOptionsTask: Lazy<SourceTask?> = lazyOf(null)
|
||||||
|
|||||||
-4
@@ -371,10 +371,6 @@ constructor(
|
|||||||
val enabledLanguageFeatures: Set<String>
|
val enabledLanguageFeatures: Set<String>
|
||||||
@Input get() = languageSettings.enabledLanguageFeatures
|
@Input get() = languageSettings.enabledLanguageFeatures
|
||||||
|
|
||||||
@Deprecated("Unsupported and will be removed in next major releases", replaceWith = ReplaceWith("optInAnnotationsInUse"))
|
|
||||||
val experimentalAnnotationsInUse: Set<String>
|
|
||||||
@Internal get() = languageSettings.experimentalAnnotationsInUse
|
|
||||||
|
|
||||||
val optInAnnotationsInUse: Set<String>
|
val optInAnnotationsInUse: Set<String>
|
||||||
@Input get() = languageSettings.optInAnnotationsInUse
|
@Input get() = languageSettings.optInAnnotationsInUse
|
||||||
// endregion.
|
// endregion.
|
||||||
|
|||||||
@@ -11,7 +11,5 @@ interface LanguageSettings {
|
|||||||
val progressiveMode: Boolean
|
val progressiveMode: Boolean
|
||||||
val enabledLanguageFeatures: Set<String>
|
val enabledLanguageFeatures: Set<String>
|
||||||
|
|
||||||
@Deprecated("Unsupported and will be removed in next major releases", replaceWith = ReplaceWith("optInAnnotationsInUse"))
|
|
||||||
val experimentalAnnotationsInUse: Set<String>
|
|
||||||
val optInAnnotationsInUse: Set<String>
|
val optInAnnotationsInUse: Set<String>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user