baxter
05/21/2025, 8:30 PMlibrary
depends on feature
• library
also depends on a custom ksp processor
The problem I'm running into is that when I make a change in the strings.xml
file in feature
, the first run generates the source files fine from my ksp processor, but the second run fails due to the generated files being deleted and not generated.
It seems to be an issue with incremental builds, because turning incremental off will cause everything to generate just fine. More in 🧵:baxter
05/21/2025, 8:31 PM@OptIn(KspExperimental::class)
override fun process(resolver: Resolver): List<KSAnnotated> {
val symbols = resolver.getSymbolsWithAnnotation(
annotationName = AppLifecycleSingleton::class.qualifiedName.toString(),
).filterIsInstance<KSClassDeclaration>()
if (symbols.none()) { // returns true on incremental builds
return emptyList()
}
// Goes here on first run and with incremental ksp turned off
val appLifecycleSingletons = symbols.map { it.accept(appLifecycleSingletonVisitor, Unit) }
.flatten()
baxter
05/21/2025, 8:31 PMJacob Kwitkoski
05/22/2025, 8:00 PMstrings.xml
is not source code, so how would KSP know to re-run if it changes?
Are you attempting to use the R.string values from within KSP?baxter
05/22/2025, 8:04 PM