Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
KSP function processor, process function, file
class FunctionProcessor(...) : SymbolProcessor {
override fun process(resolver: Resolver): List<KSAnnotated> {
...
val file: OutputStream = codeGenerator.createNewFile(
// Make sure to associate the generated file with sources to keep/maintain it across incremental builds.
// Learn more about incremental processing in KSP from the official docs:
// https://github.com/google/ksp/blob/main/docs/incremental.md
dependencies = Dependencies(false, *resolver.getAllFiles().toList().toTypedArray()),
packageName = "com.morfly",
fileName = "GeneratedFunctions"
)
file += "package com.morfly\n"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment