Nizam
11/21/2024, 1:40 AMNizam
11/21/2024, 1:44 AMorg.gradle.jvmargs=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -Dkotlin.daemon.jvm.options=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
kotlin.code.style=official
android.nonTransitiveRClass=true
android.nonFinalResIds=false
android.enableJetifier=false
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.daemon=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn
ksp.incremental=true
ksp.incremental.log=true
what am I missing here? we use these dependencies with ksp
ksp "androidx.room:room-compiler:$room_version"
ksp "io.github.raamcosta.compose-destinations:ksp:$raamcostaVersion"
ksp 'androidx.hilt:hilt-compiler:1.2.0'
ksp "com.google.dagger:hilt-compiler:$hilt_version"
In case a dependency is not supporting incremental build, how to find that?glureau
11/21/2024, 8:06 AMNizam
11/21/2024, 1:48 PMNizam
11/21/2024, 2:31 PMNizam
11/22/2024, 6:23 PMprivate fun Resolver.getComposableDestinationPaths(
annotationQualifiedName: String = DESTINATION_ANNOTATION_QUALIFIED,
annotationsPath: DestinationAnnotationsPath = DestinationAnnotationsPath()
): Sequence<DestinationAnnotationsPath> {
val symbolsWithAnnotation = getSymbolsWithAnnotation(annotationQualifiedName)
return symbolsWithAnnotation.flatMap {
createPaths(
annotationQualifiedName,
it,
annotationsPath.copy()
)
}
}
David Rawson
11/22/2024, 10:48 PMalways gives all the files instead of giving incrementally modified aloneCould it be that the processor needs to use the
Dependencies
API?
There is an explanation here:
https://github.com/google/ksp/blob/main/api/src/main/kotlin/com/google/devtools/ksp/processing/CodeGenerator.kt#L59
And also:
https://square.github.io/kotlinpoet/interop-ksp/#incremental-processing
You can debug the incremental processing by turning on logs:
https://kotlinlang.org/docs/ksp-incremental.html#reporting-bugsNizam
11/23/2024, 7:12 AMclass KspCodeOutputStreamMaker(
private val codeGenerator: CodeGenerator,
private val sourceMapper: KSFileSourceMapper
) : CodeOutputStreamMaker {
override val packageNamesWrittenTo = mutableListOf<String>()
override fun makeFile(
name: String,
packageName: String,
extensionName: String,
vararg sourceIds: String
): OutputStream {
val sources = sourceIds.mapNotNull { sourceMapper.mapToKSFile(it) }.toTypedArray()
val dependencies = if (sources.isEmpty()) {
Dependencies.ALL_FILES
} else {
Dependencies(
false,
*sources
)
}
packageNamesWrittenTo.add(packageName)
return codeGenerator.createNewFile(
dependencies = dependencies,
fileName = name,
packageName = packageName,
extensionName = extensionName
)
}
}