Last active
April 16, 2022 05:49
-
-
Save Morfly/ebf3df3aa874af6c93faac968e7e6a7d to your computer and use it in GitHub Desktop.
KSP function processor, process function, file
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
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://kotlinlang.org/docs/ksp-incremental.html | |
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