Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make lenses genration more resilient with KSP >= 1.9.x #855

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

Lysander
Copy link
Collaborator

@Lysander Lysander commented Feb 22, 2024

Obviously the ksp based LensesAnnotationProcessor was more resilient in the past before we upgraded to Kotlin 1.9.x and appropriate ksp with RC15.

We encountered some issues with generating lenses that only came with this bad warning:

w: [ksp] Unable to process:dev.fritz2.lens.LensesProcessor:   SomeClass

This was due to some not resolvable types inside the annotated data class, like calls to functions from other libs or delegated properties. With former ksp-versions those problems did not arise - so obviously ksp has evolved since then and got stronger constraints for the evaluate-function.

This PR fixes such issues, as we ignore everything from the annotated class but the primary constructor. The latter is the only interesting piece for our lens generation.

Obviously the KSP based LensesAnnotationProcessor was more resilient in the past before we upgraded to Kotlin 1.9.x and appropriate KSP with RC15.

We encountered some issues with generating lenses that only came with this bad warning:
```
w: [ksp] Unable to process:dev.fritz2.lens.LensesProcessor:   SomeClass
```

This was due to some not resolvable types inside the annotated data class, like calls to functions from other libs or delegated properties. This PR fixes such issues, as we ignore everything from the annotated class but the primary constructor. The latter is the only interesting piece for our lens generation.
@Lysander Lysander added the enhancement New feature or request label Feb 22, 2024
@Lysander Lysander added this to the 1.0-RC17 milestone Feb 22, 2024
@Lysander Lysander requested a review from jamowei February 22, 2024 17:01
@Lysander Lysander self-assigned this Feb 22, 2024
@jamowei jamowei merged commit 7669d2a into master Feb 23, 2024
2 checks passed
@jamowei jamowei deleted the chausknecht/fix-ksp branch February 23, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants