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?Császár Ákos
03/19/2024, 7:26 AMjava.lang.ClassNotFoundException: TestProcessorProvider
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
The TestProcessorProvider is registered in resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider
.
Can somebody tell me, what am I missing?Cherrio LLC
03/20/2024, 12:04 PMEdoardo Luppi
03/21/2024, 12:02 AMroot/
one
two
two
depends on one
.
Now, I'd like one
to generate an interface that can be used in two
. However that interface should only be available in two
.
Or can I move the KSP generation in two
and look up annotated classes of one
?hfhbd
03/27/2024, 11:48 AMkspCommonMainMetadata
configuration, but it appears KSP isn't able to get the values for an annotation, the values are always null. Or is this a bug in Kotlin metadata?Adrian Witaszak
03/28/2024, 5:57 PM@Route
, in the OpenApi module i want to pickup those annotations to generate the spec. The issue is that if i apply the processor to the openApi module it sees its only module but not submodules. Is there any trick for it?
- annotation
- processor
- open-api // here i need to generate code. Processor applied here
- function // lambda functions here
- getHello // here i use the annotation
- addHello // here i use the annotation
Jithin Murali
03/29/2024, 9:44 AMbuild/generated/ksp/variantname/kotlin
Can i able to change this path to a custom path bcoz i had problem with the variant naming.ralf
03/29/2024, 6:01 PMFileAlreadyExistsException
and I’m unsure how to approach the solution. In my processor I want combine multiple interfaces to a single interface. These interfaces can be generated by any processor including mine. The write of the combined interface could happen in finish()
, but this combined interface must be fed to another processor that I don’t own one last time. I’m struggling to know for certain what’s the last round from my processors point of view.
For example, my processor can’t know if another processor will generate more of the interfaces that need to be combined, that can happen one or two rounds later. Is it the last round for my processor to create and write the combined interface or not? That’s hard to tell. Any suggestion?Jiaxiang
04/05/2024, 12:57 AMStanislav Maksimov
04/07/2024, 2:09 PM@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
@TargetAlias(target = SomeTarget::class)
annotation class AliasAnnotation
@Target(AnnotationTarget.ANNOTATION_CLASS)
@Retention(AnnotationRetention.SOURCE)
annotation class TargetAlias(val target: KClass<out Target>)
interface SomeView {
@AliasAnnotation
fun doSomething()
}
For some reason, when I'm processing doSomething
method and trying to get annotations for @AliasAnnotation
declaration I only get @Target
and @Retention
annotations, but not @TargetAlias
. Is it some known KSP limitation or maybe bug?
I'm getting annotations like this:
methodDeclaration.annotations.first().annotationType.resolve().declaration.annotations.toList()
John O'Reilly
04/10/2024, 5:25 PM