Skip to content

Add initial gradle support #1

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

Merged
merged 4 commits into from
Apr 25, 2025
Merged

Conversation

samneirinck
Copy link
Contributor

@samneirinck samneirinck commented Apr 12, 2025

Adds initial support for Gradle via Gradle Tooling.

It does so by implementing the GradleBuildSystem class, letting Gradle Tooling resolve all modules/dependencies, and then map those to the correct LibraryModule and SourceModules.

Verified this locally on neovim with no additional configuration required.

@samneirinck
Copy link
Contributor Author

As a note, this branch might be idle for about a week, was just excited to see this project @amgdev9 so took a stab at it right before I'm leaving for holiday 😅.

@amgdev9
Copy link
Owner

amgdev9 commented Apr 13, 2025

Hi @samneirinck! Thanks for your PR 😄

How do we communicate the path of the project? I'm currently passing around the rootPath but it probably needs to be stored on the MockProject?

For now just pass it as an argument, when this grows we'll see to refactor the gradle resolver into a class or context receiver

Verify JDK support works as expected (seemed to work fine on my own project with buildStandaloneAnalysisAPISession and buildKtModuleProvider calls, but couldn't run it correctly yet here

Right now JDK dependency is not working in the LSP, I'm currently working on it and just today I got imports to be resolved correctly, but there are some services to implement to get rid of all the error diagnostics. Step by step 🚀

As a note, this branch might be idle for about a week, was just excited to see this project @amgdev9 so took a stab at it right before I'm leaving for holiday 😅.

No worries! Take your time, there is still plenty to do, this project is just starting

@lppedd
Copy link

lppedd commented Apr 15, 2025

I'm currently working on it and just today I got imports to be resolved

Does this LSP aim to target Kotlin with the full Multiplatform targets, or just the JVM part?

@amgdev9
Copy link
Owner

amgdev9 commented Apr 15, 2025

I'm currently working on it and just today I got imports to be resolved

Does this LSP aim to target Kotlin with the full Multiplatform targets, or just the JVM part?

Right now I am focusing on jvm support, but the rest of the targets we can provide support for them as well in the future no problem

@lppedd
Copy link

lppedd commented Apr 15, 2025

we can provide support for them

Nice, thanks. I have asked because K/M support is a must have (imo) for Kotlin's usability.
I have seen people using the Multiplatform plugin even when only using the JVM target.

@samneirinck samneirinck force-pushed the support-gradle branch 4 times, most recently from 20e3e90 to fa61c9b Compare April 23, 2025 20:37
@samneirinck
Copy link
Contributor Author

Rebased on the latest main and pushed an update which seems to work nicely now. I'd say it's ready for review and we can tackle multi-module / progress reporting later on.

@samneirinck samneirinck changed the title WIP: Add initial gradle support Add initial gradle support Apr 23, 2025
Copy link
Owner

@amgdev9 amgdev9 left a comment

Choose a reason for hiding this comment

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

Great work, thank you so much for your contribution!

@amgdev9 amgdev9 merged commit 4c33acb into amgdev9:main Apr 25, 2025
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.

None yet

3 participants