Last active
February 20, 2021 05:50
-
-
Save SeongUgJung/7738b81a5462b4824032d8398aa53bba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val targets = mutableListOf<KSClassDeclaration>() | |
override fun process(resolver: Resolver): List<KSAnnotated> { | |
// read @JsonClass annoted class | |
val symbols = resolver.getSymbolsWithAnnotation("com.squareup.moshi.JsonClass") | |
symbols.filter { ksAnnotated -> | |
// only filter out class. | |
ksAnnotated is KSClassDeclaration && ksAnnotated.validate() | |
} | |
.forEach { kSClassDeclaration -> | |
// look browse class information via CustomKSVisitor | |
kSClassDeclaration.accept(CustomKSVisitor(targets), Unit) | |
} | |
return emptyList() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment