1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-03 07:09:23 +00:00

add file annotations generation to the class casts

This commit is contained in:
2022-08-05 18:57:50 +06:00
parent bbdff0b31a
commit 6a06775bc4
2 changed files with 22 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import com.google.devtools.ksp.getAllSuperTypes
import com.google.devtools.ksp.processing.*
import com.google.devtools.ksp.symbol.KSAnnotated
import com.google.devtools.ksp.symbol.KSClassDeclaration
import com.squareup.kotlinpoet.AnnotationSpec
import com.squareup.kotlinpoet.FileSpec
import com.squareup.kotlinpoet.ksp.writeTo
import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded
@@ -43,6 +44,17 @@ class TelegramBotAPISymbolProcessor(
targetPackage,
outputFile
).apply {
addAnnotation(
AnnotationSpec.builder(Suppress::class).apply {
addMember("\"unused\"")
addMember("\"RemoveRedundantQualifierName\"")
addMember("\"RedundantVisibilityModifier\"")
addMember("\"NOTHING_TO_INLINE\"")
addMember("\"UNCHECKED_CAST\"")
addMember("\"OPT_IN_USAGE\"")
useSiteTarget(AnnotationSpec.UseSiteTarget.FILE)
}.build()
)
classes.forEach {
fill(
it,