Propagate option deprecation to options impl class
This is to avoid the new warning OVERRIDE_DEPRECATION that is reported when a base method is deprecated and an overriding method is not.
This commit is contained in:
committed by
TeamCityServer
parent
7917e511ed
commit
bd856ad726
@@ -202,11 +202,13 @@ private fun Printer.generateImpl(
|
|||||||
println()
|
println()
|
||||||
val propertyType = property.gradleReturnType
|
val propertyType = property.gradleReturnType
|
||||||
if (propertyType.endsWith("?")) {
|
if (propertyType.endsWith("?")) {
|
||||||
|
generateOptionDeprecation(property)
|
||||||
generatePropertyDeclaration(property, modifiers = "override", value = "null")
|
generatePropertyDeclaration(property, modifiers = "override", value = "null")
|
||||||
} else {
|
} else {
|
||||||
val backingField = property.backingField()
|
val backingField = property.backingField()
|
||||||
val visibilityModified = property.gradleBackingFieldVisibility.name.lowercase(Locale.US)
|
val visibilityModified = property.gradleBackingFieldVisibility.name.lowercase(Locale.US)
|
||||||
println("$visibilityModified var $backingField: $propertyType? = null")
|
println("$visibilityModified var $backingField: $propertyType? = null")
|
||||||
|
generateOptionDeprecation(property)
|
||||||
generatePropertyDeclaration(property, modifiers = "override")
|
generatePropertyDeclaration(property, modifiers = "override")
|
||||||
withIndent {
|
withIndent {
|
||||||
println("get() = $backingField ?: ${property.gradleDefaultValue}")
|
println("get() = $backingField ?: ${property.gradleDefaultValue}")
|
||||||
|
|||||||
Reference in New Issue
Block a user