Skip to content

Instantly share code, notes, and snippets.

@PaulWoitaschek
Last active November 18, 2021 20:53
Show Gist options
  • Save PaulWoitaschek/1332fd3da39eca513968dda97352ec08 to your computer and use it in GitHub Desktop.
Save PaulWoitaschek/1332fd3da39eca513968dda97352ec08 to your computer and use it in GitHub Desktop.
internal class SwiftGenProcessor(
private val environment: SymbolProcessorEnvironment
) : SymbolProcessor {
private var invoked = false
override fun process(resolver: Resolver): List<KSAnnotated> {
if (invoked) {
return emptyList()
}
invoked = true
val generator = EnumGenerator(environment.codeGenerator)
resolver.getSymbolsWithAnnotation("com.yazio.shared.common.SwiftExport")
.forEach {
it as KSClassDeclaration
generator.generate(it)
}
return emptyList()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment