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
Implement Resolver.getModuleName API #1649
Conversation
Could you run |
I added a test but was surprised to find that K1 and K2 have different behavior here 😰. The APIs appear to be the same in docs, but K1 uses the project module name and K2 appears to use the source set name. Lmk what you want to do, or if you're fine with the current difference and can explore more later |
Weirder still, this test worked for me locally at first, and now... doesn't appear to run the processor at all? 🫠 |
Inconsistent behavior is expected between K1 and K2, it is better to confirm with JB on this inconsistency to see if that's the expected behavior from their side, we are OK with inconsistent behavior if it is expected. |
val gradleRunner = GradleRunner.create().withProjectDir(project.root) | ||
gradleRunner.withArguments("build").build().let { result -> | ||
// TODO figure out why K2 uses the source set name and K1 uses the project name | ||
val expectedName = if (useKSP2) "workload" else "main" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the comment, should this be in the reversed order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the difference also observed in the mangled jvm names in K1 and K2? If so, for the purpose of the issue referenced, they have to be different in KSP too. Otherwise, either the KSP1 or KSP2 changes need to be adjusted. By the way, don't |
Apologies, I completely forgot about this. Asking for clarification on the K2 behavior change in kotlin-lang slack here: https://kotlinlang.slack.com/archives/C03PK0PE257/p1709960362349149
Could you elaborate on this? I wasn't sure what you're referring to but maybe it's because I just haven't looked at this in a minute |
I'm fairly convinced at this point that |
@ting-yuan after feedback on the above issue, I think I've resolved this 🥳 |
I mean, should |
It's possible, but there are so many added permutations for handling custom getters, |
@ting-yuan @neetopia anything else you need from me for this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the patch! Would you mind to rebase it to ToT so that it can be cherry-picked into release branches by CI?
Rebase or is merging latest main ok? |
@ting-yuan done but let me know if you'd prefer a full rebase. I try to avoid it after having done main merges due to code review and also git's propensity for uh, not handling mixing them well 😅 |
I'd really appreciate a full rebase. Our auto-cherry-picker doesn't work with merge very well 😢 Don't worry about the review. I'll go through it quickly again before merging. |
I'm just going to open a fresh PR with the changes then |
Resolves #1621