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

Add support for KSP #323

Merged
merged 31 commits into from
Jun 29, 2021
Merged

Add support for KSP #323

merged 31 commits into from
Jun 29, 2021

Conversation

rossbacher
Copy link
Collaborator

@rossbacher rossbacher commented Jun 25, 2021

Added support for KSP (https://github.com/google/ksp) via Rooms XProcessing library (https://github.com/androidx/androidx/tree/androidx-main/room/room-compiler-processing) as so we can still support kapt and java annotation processor.

Note: The tests are currently failing as there is a bug that causes issues with sub classes right now, still investigating this.

Few other changes:

Andreas Rossbacher added 22 commits June 15, 2021 13:43
…v:kotlin-compile-testing for testing.

Moved all tests over and make them more meaningful by testing what ends up in the index instad of just 1:1 ow which code they generate) which with the index bing binary is unverifiable.
Removed old unused dependencies
Check generated source on top of functionality
Split method and class elements into two sets for processing
Fixed index generation for inner classes
Added processor test with inner class
Enabled ksp for sample project
Fix originalting elment for Registry generation.
Made unit test when running via ksp not to compiled code check.
Fix warning
Updated gradle to 7.1
Clean up gralde plugin dependency for ksp.
Updated documentation.
Remove airbnb repo dependency
Also add ktlint to ci checks.
…et the custom processors from config.

Use testKsp to test that behavior.
Copy link

@BenSchwab BenSchwab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome - thanks for all the Koltin conversions, setting up ktlint and mockk! I'll take a look at the inner class error and see if I have any insight

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved

```groovy
ksp {
arg("deepLink.incremental", "true")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about removing the non incremental option? Looking through this PR, it would reduces complexity, and really everyone should want to use incremental.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted to keep it backwards compatible. It would imho not reduce complexity by that much. But it can be on the chopping block if it does not fit with any other major changes.

@rossbacher
Copy link
Collaborator Author

Awesome - thanks for all the Koltin conversions, setting up ktlint and mockk! I'll take a look at the inner class error and see if I have any insight

@BenSchwab I created an issue ticket with ksp here google/ksp#492 for the inner class error.

Andreas Rossbacher added 3 commits June 29, 2021 13:00
Copy link

@BenSchwab BenSchwab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

README.md Outdated

When using Kotlin we strongly suggest to use KSP as it can bring major speed improvements.
We ran into issues when enabling KSP on a project while the Kapt plugin was still applied.
If you want to both use Kapt and KSP processors on the same project be careful and expect

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how much of this was just caused by the no java sources issues - Eli talked a bit more to the KSP team, and running both kapt and ksp should be fine, so long as no kapt processor depends on the ksp generated sources

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wanted to remove this actually, thx for pointing it out.

@rossbacher rossbacher merged commit 218c162 into master Jun 29, 2021
@rossbacher rossbacher deleted the supportKsp branch June 29, 2021 20:56
@elihart elihart mentioned this pull request Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants