ritesh
02/10/2024, 4:42 PMroom.incremental
flag should have no affect in ksp - it should be removed? I believe it was added for java incremental processing, for ksp migration it should be removed.
And any flag passed to java annotation processor should be move to ksp block
From
android {
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
room {
schemaLocationDir.set(file("schemas"))
}
arguments += [
"room.incremental": "true"
]
}
}
}
}
to just
ksp {
arg("room.schemaLocation", "schemas")
}
Zac Sweers
02/12/2024, 7:44 AMritesh
02/12/2024, 12:39 PMepoxy
More in 🧵eygraber
02/19/2024, 9:33 PMAlex Spence
02/19/2024, 10:40 PMnew.adjustments + expanded.adjustments
From
val adjustmentWins get() = new.adjustments + expanded.adjustments
Wojciech Zięba
02/20/2024, 5:50 PMDependencies
I set aggregating=true
, then “the output should be invalidated by a new source file or a change in any of the existing files”. If so, is there a point of setting originatingFiles
in such case, or originatingFiles
only makes sense if aggregating=false
?eygraber
02/20/2024, 5:51 PMactual
modifier, that KsClassDeclaration.isActual
will return false
?Daniil Elovkov
02/26/2024, 5:13 PMKSPJvmConfig
with all the paths and get an exception. (It’s in the 🧵) The exception is supposed to tell me that no module containing the kotlin file can be found.
Unfortunately, it’s hard to debug how it’s searching for the module. But what I can see in the exception attachment, is that paths (of the file and search scope) seem to match.
Has anybody have ideas what could be wrong here?Zac Sweers
02/29/2024, 4:57 AMeygraber
03/01/2024, 5:44 AMkspKotlinJvm
task:
e: [ksp] java.lang.IllegalStateException: Unexpected type element class org.jetbrains.kotlin.psi.KtFunctionType, please file a bug at https://github.com/google/ksp/issues/newWhat information is needed to file the bug report?
Zac Sweers
03/01/2024, 8:46 PM> Task :compose-lint-checks:kspTestKotlin FAILED
e: [ksp] com.intellij.openapi.util.io.FileTooBigException: /Users/zacsweers/.gradle/caches/modules-2/files-2.1/com.android.tools.lint/lint-checks/31.4.0-alpha12/2fed220cbe448292ff70bd45baf696e7de1afbd7/lint-checks-31.4.0-alpha12.jar!/private-apis.txt
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compose-lint-checks:kspTestKotlin'.
> A failure occurred while executing com.google.devtools.ksp.gradle.KspAAWorkerAction
> /Users/zacsweers/.gradle/caches/modules-2/files-2.1/com.android.tools.lint/lint-checks/31.4.0-alpha12/2fed220cbe448292ff70bd45baf696e7de1afbd7/lint-checks-31.4.0-alpha12.jar!/private-apis.txt
Should we file a bug report for this or are there actually issues with the file it's reading?Edoardo Luppi
03/02/2024, 12:46 PMKS*
instances be used as map keys?
An example could be a map of `KSFile`s to `KSFunctionDeclaration`s.Jey
03/05/2024, 8:44 PMDmytro Serdiuk
03/06/2024, 12:28 AMkotlin { sourceSets {
main.kotlin.srcDirs += 'build/generated/ksp/main/kotlin'
test.kotlin.srcDirs += 'build/generated/ksp/test/kotlin' }
}
If you are using IntelliJ IDEA and KSP in a Gradle plugin then the above snippet will give the following warning:
Execution optimizations have been disabled for task ':publishPluginJar' to ensure correctness due to the following reasons: Gradle detected a problem with the following location: '../build/generated/ksp/main/kotlin'.
Reason: Task ':publishPluginJar' uses this output of task ':kspKotlin' without declaring an explicit or implicit dependency.
how this setup relates to publishPluginJar?
ThanksRafael Costa
03/06/2024, 3:07 PMFirstType
and SecondType
?
I am able to get the KSType corresponding to AbcType
, but not the other two.
ExternalModuleDestinations
is an annotation class ExternalModuleDestinations<T: SomeType>
and ExternalDestination
is also annotation class ExternalDestination<T: OtherType>
.
@ExternalModuleDestinations<AbcType>(
overriding = [
ExternalDestination<FirstType>(),
ExternalDestination<SecondType>(),
]
)
class SomeClass
When I try, I just get T
, not the actual types used here (FirstType
and SecondType
)Rafael Costa
03/07/2024, 1:40 PMtypealias SomeName = SomeAnnotation
Such that when I do Resolver.getSymbolsWithAnnotation("package.name.SomeAnnotation")
I would also get symbols annotated with SomeName
. Or I am open to doing something else on my side to have symbols annotated by a typealias to be considered of course 🙂
Is there a way to do this? I can't seem to make it work..Ting-Yuan Huang
03/08/2024, 12:27 AMRobert Jaros
03/08/2024, 6:26 AMksp.useKSP2=true
flag. Should it be used in a "provider" project (the project containing the KSP processor) or in a "consumer" project (the one using ksp plugin to generate code)? When I set this flag in my micronaut project I have errors running micronaut's processor.hfhbd
03/08/2024, 8:46 AMDavid Herman
03/08/2024, 8:01 PMToshihiro Nakamura
03/09/2024, 2:11 AMannotation class MyAnnotation(val type: KClass<*> = String::class)
When retrieving the type element in SymbolProcessor, it returns a KSErrorType.
val annotation = symbol.annotations.first { it.shortName.asString() == MyAnnotation::class.simpleName }
val type = annotation.arguments.first().value
env.logger.warn("type: $type") // type: <ERROR TYPE>
Is this a known issue?Dmytro Serdiuk
03/11/2024, 12:17 PMPropagation by resolution tracing: Resolving a type reference (implicitly or explicitly) is the only way to navigate from one file to another. When a type reference is resolved by a processor, a changed or affected file that contains a change that may potentially affect the resolution result will affect the file containing that reference.
May I ask to explain with details or give some example?
ThanksDmytro Serdiuk
03/12/2024, 4:48 PMZac Sweers
03/14/2024, 5:27 AMResolver.getDeclarationsFromPackage()
to allow including subpackages too? We have a good use case for this in AnvilDmytro Serdiuk
03/14/2024, 8:09 PMDmytro Serdiuk
03/17/2024, 5:49 PMuli
03/18/2024, 7:44 AMcompileCommonMainKotlinMetadata
due to an error in one of my actual app source files. (just a typo in the imports).
> I don’t think I have ever seen that on pure android projects so it was quite surprising to me to see that the actual app sources are relevant for the sync process. And it is a real pain to make the app sources compile again without your IDE working.
>
> Am I doing something wrong here?
> Is this just a plain (known?) bug that needs to be fixed in the gradle plugin?
> Or does it work as designed due to some multi platform requirements?
>
> I’d be thankful if anyone could shed some light on that issue.Devanshu Pathsariya
03/18/2024, 1:01 PMYurii Surzhykov
03/18/2024, 6:39 PMjw
03/18/2024, 9:23 PMprocess
function only allow returning annotated symbols rather than any symbol?