Rename DeprecatedOption into GradleDeprecatedOption
This should make it more explicit ^KT-49011 In Progress
This commit is contained in:
@@ -183,7 +183,7 @@ fun main() {
|
||||
}
|
||||
|
||||
private inline fun <reified T : Any> List<KProperty1<T, *>>.filterToBeDeleted() = filter { prop ->
|
||||
prop.findAnnotation<DeprecatedOption>()
|
||||
prop.findAnnotation<GradleDeprecatedOption>()
|
||||
?.let { LanguageVersion.fromVersionString(it.removeAfter) }
|
||||
?.let { it >= LanguageVersion.LATEST_STABLE }
|
||||
?: true
|
||||
@@ -289,7 +289,7 @@ private fun Printer.generatePropertyDeclaration(property: KProperty1<*, *>, modi
|
||||
}
|
||||
|
||||
private fun Printer.generateOptionDeprecation(property: KProperty1<*, *>) {
|
||||
property.findAnnotation<DeprecatedOption>()
|
||||
property.findAnnotation<GradleDeprecatedOption>()
|
||||
?.let { DeprecatedOptionAnnotator.generateOptionAnnotation(it) }
|
||||
?.also { println(it) }
|
||||
}
|
||||
@@ -320,7 +320,7 @@ private fun generateMarkdown(properties: List<KProperty1<*, *>>) {
|
||||
for (property in properties) {
|
||||
val name = property.name
|
||||
if (name == "includeRuntime") continue // This option has no effect in Gradle builds
|
||||
val renderName = listOfNotNull("`$name`", property.findAnnotation<DeprecatedOption>()?.let { "__(Deprecated)__" })
|
||||
val renderName = listOfNotNull("`$name`", property.findAnnotation<GradleDeprecatedOption>()?.let { "__(Deprecated)__" })
|
||||
.joinToString(" ")
|
||||
val description = property.findAnnotation<Argument>()!!.description
|
||||
val possibleValues = property.gradleValues.possibleValues
|
||||
@@ -363,7 +363,7 @@ private inline fun <reified T> KAnnotatedElement.findAnnotation(): T? =
|
||||
annotations.filterIsInstance<T>().firstOrNull()
|
||||
|
||||
object DeprecatedOptionAnnotator {
|
||||
fun generateOptionAnnotation(annotation: DeprecatedOption): String {
|
||||
fun generateOptionAnnotation(annotation: GradleDeprecatedOption): String {
|
||||
val message = annotation.message.takeIf { it.isNotEmpty() }?.let { "message = \"$it\"" }
|
||||
val level = "level = DeprecationLevel.${annotation.level.name}"
|
||||
val arguments = listOfNotNull(message, level).joinToString()
|
||||
|
||||
Reference in New Issue
Block a user