star_zero
09/24/2021, 6:06 AMaggregating of Dependencies is set to true, will even file changes that are not related to a particular annotation be reprocessed?
val symbols = resolver.getSymbolsWithAnnotation("Factory")
symbols.forEach { symbol ->
val ksClass = symbol as KSClassDeclaration
val packageName = ksClass.packageName.asString()
val className = ksClass.simpleName.asString()
val file = codeGenerator.createNewFile(
Dependencies(true, ksClass.containingFile!!), // <--
packageName,
"${className}Factory"
)
// generate code ...
}star_zero
09/24/2021, 6:12 AMDependencies(false, ksClass.containingFile!!)star_zero
09/25/2021, 4:35 AMDependencies(false, files) => Reprocess when any file changes. Ignore the file passed to the parameter.
• Dependencies(true, files) => Reprocess only when the file passed to the parameter changes.
Is this right?Ting-Yuan Huang
09/25/2021, 5:16 AMaggregating=true means that an output may potentially depend on new information, which can come from either new files, or changed existing files. aggregating=false means that processor is sure that the information only comes from certain input files and never from other or new files.star_zero
09/25/2021, 8:32 AMDependencies(true) => Only changed files will be input.
Dependencies(true, files) => Changed files and associated files will be input.star_zero
09/25/2021, 9:01 AM