-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
generate QClasses with KSP #638
Comments
Hello @velo I am the author of https://github.com/IceBlizz6/querydsl-ksp Since starting this project multiple people has reached out to me (including OP) to ask about the possibility to I wanted to start a discussion to hear your thoughts on this and how you would like to proceed, I think this may be the simplest and quickest path for you seeing as you have limited time and i have already fleshed out a lot of the code. |
Hello @IceBlizz6 , nice to meet you =) I have no objections for you to submit a PR to include ksp support to this queryDSL fork AND for you to get maintenance access level for this repository. Ideally, I would say to use a Just two things you will need to be aware and stick to:
I know it would be a shore, but I'm sure eventually I will need to touch this, so need at least to make consistent with the rest of the project. Please let me know if you want to proceed. |
Ow, and if kapt is indeed going away, might be a good thing to deprecate it left and right. |
I will close this to clear the board. But feel free to reopen it when you are happy to get this started. Thanks |
I will look into this, i don't think i'm using any specific gradle functionality.
I never published to maven central, i spent some time trying to figure this out but it seemed like they were in the middle of a big migration and most guides were outdated.
There are tests actually, but only on my local machine. The other problem with this package is that the tests are actually running Kotlin code through the compiler so the tests feels heavy. Testing for this project can be split up into 2 parts
I'm not sure if it's possible to do 1. without com.github.tschuchortdev:kotlin-compile-testing-ksp and i have yet to find another library with similar functionality. In conclusion i think i may only be able to provide tests covering 2. for now.
Did you intend to reference a readme file? Also do you want to continue discussion here in this issue? |
I'm happy to continue the discussion here. Maybe you can duplicate the existing example that uses kapt to use ksp and that would be enough testing for now. How does that sound? |
Also, you should be able to have a test module that overrides kotlin versions; |
Existing tests in querydsl-kotlin-codegen only tests for 2. ([Intermediate models] -> [Q-classes]) KSP needs to read it as Kotlin code, so cannot go through the exact same process. My project has its own set of intermediate model representations now, i'm not sure if i should keep those as is or try to use the representation that QueryDSL is using for java classes (EntityType).
I will look into this. |
Ow, when I say examples I mean https://github.com/OpenFeign/querydsl/tree/master/querydsl-examples/querydsl-example-kotlin-codegen So you can have a querydsl-example-kotlin-ksp example that will generate the code and then run unit tests over it to have at least end to end testing. |
Do you have a guide on compiling your project? I got through a few of the errors already. Now i'm on this error
Also maven cannot locate this plugin, But that could be resolved by solving the error above. |
These is one of many things needed.
Need to create and include java 11, 17 and 21, something like this:
I have no idea how
make sure to use mvnw ...
|
Think i finished the module now.
I named it querydsl-ksp-codegen and put it under querydsl-tooling. Still lots of issues with building the project, i got through mvnw install command after deleting 600+ test files. I'm not sure if i will be able to create a maven example, there doesn't seem to be any good KSP support for maven projects. It worked well in my gradle example project, but you mentioned that you didn't want gradle to be included. |
Run ./mvnw clean install -Pdev, it still run tests, but not all |
If gradle completely unavoidable, we could use one of the maven plugins that run gradle behind the scenes. My concern is how well they would integrate during release process |
To be clear gradle was not necessary for making the KSP module. We could skip the example project or we could try the maven plugin for gradle. |
Send the example on a separated PR, I'm ok with a gradle example
…On Sat, Oct 19, 2024, 06:40 IceBlizz6 ***@***.***> wrote:
To be clear gradle was not necessary for making the KSP module.
But it may be necessary for the example project.
We could skip the example project or we could try the maven plugin for
gradle.
How do you want to proceed?
—
Reply to this email directly, view it on GitHub
<#638 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABBLDV6SUWJMC2QD73ME53Z4ISITAVCNFSM6AAAAABQC4QVKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRTG4ZDEOJVHA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
How is the example coming along? Just waiting on it for a new release |
Hey, i apologize for the delay, things are happening at work. So we agreed that it was acceptable for this example to be in gradle, right? I tested a bit and it seems like this works, it takes the 6.9-SNAPSHOT version that was installed into maven local when i built the project. So i'm able to import that into gradle. repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation("io.github.openfeign.querydsl:querydsl-core:6.9-SNAPSHOT")
ksp("io.github.openfeign.querydsl:querydsl-ksp-codegen:6.9-SNAPSHOT")
} The example now runs as expected, the main method does nothing, it has a few entity and mappedsuperclass classes. What do you think? |
My expectations for the example is something similar to existing examples. A project that you build, generate querydsl artifacts, compile and then run a few test that do access an in-memory database. They operate almost as end 2 end testing or a happy path. |
@IceBlizz6 are we good to release? |
I am not aware of any issues ,so yes. |
@IceBlizz6 Hey, I just created a PR with some fixes for the KSP functionality. Would you have some time to take a look? #718 |
Would it be possible for KSP to work with this fork to generate QClasses? Kapt is in maintenance mode and I'd like to move on from it.
The text was updated successfully, but these errors were encountered: