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

Handle Gradle dependencies in modules #1862

Closed
4 tasks done
DamnClin opened this issue May 28, 2022 · 12 comments · Fixed by #7369
Closed
4 tasks done

Handle Gradle dependencies in modules #1862

DamnClin opened this issue May 28, 2022 · 12 comments · Fixed by #7369
Assignees
Labels
area: enhancement 🔧 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ generator: internal theme: gradle $500 https://www.jhipster.tech/bug-bounties/

Comments

@DamnClin
Copy link
Collaborator

DamnClin commented May 28, 2022

Following #1787 we can add gradle dependencies handling.

TODO:

  • Update FileSystemCurrentJavaDependenciesVersionsRepository to have a strategy to handle either maven or gradle
  • Create a JavaDependenciesCommandHandler interface based on MavenCommandHandler
  • Create a GradleCommandHandler (which is a JavaDependenciesCommandHandler)
  • Update FileSystemJavaDependenciesCommandsHandler to create the most suited handler (depending on project version management)
@atomfrede
Copy link
Member

@DamnClin I have created a first draft PR, maybe you can have a short look if thats heading in the right direction #2748

@murdos
Copy link
Contributor

murdos commented Dec 26, 2022

@atomfrede : do you still intend to work on this feature? otherwise I would be happy to give it a try :-)

@atomfrede
Copy link
Member

Feel to go on. I did not much so far. I think I would have tried rewrite to handle e.g. the dependency part.

@pascalgrimaud
Copy link
Member

@murdos : if possible, try to split into small PRs or small tickets, as it will be easier to review and to add small bounties on each ;)

murdos referenced this issue in murdos/jhipster-lite Dec 27, 2022
murdos referenced this issue in murdos/jhipster-lite Dec 27, 2022
murdos referenced this issue in murdos/jhipster-lite Dec 27, 2022
It's hidden until gradle is fully supported, by handling dependencies and plugins.

Updates #1862
@murdos
Copy link
Contributor

murdos commented Jan 2, 2023

@murdos : if possible, try to split into small PRs or small tickets, as it will be easier to review and to add small bounties on each ;)

My current roadmap is:

For resolving this issue:

In other issues:

  • Handle plugins related commands, but probably in another issue, since it will probably requires changing API related to build plugins in module builder (related to this comment and to the fact that plugin in gradle only have an id and a version - no groupId and artifactId) : Handle Gradle plugins in modules #4955
  • Review all existing modules and add gradle plugins equivalent to maven ones
  • Stop hidding gradle build tool resources slug! :-)

@atomfrede
Copy link
Member

@murdos Did you do already something with regards to dependency handling? If not I will try to have a look at the open rewrite approach. They have recipes for all things we need, so maybe we can use that.

@murdos
Copy link
Contributor

murdos commented Feb 7, 2023

I have work-in-progress using needles.
I'm a bit skeptical about using openrewrite for this need, as IMO this would the setup and overhead would be overkill, but feel free to give it a try :-)

@atomfrede
Copy link
Member

I will try. From the documentation it look quite easy to call different recipes from java code. Will keep you updated when I have something to show and discuss.

@atomfrede
Copy link
Member

First thing I notice rewrite recipes only work for groovy based build.gradle not the kotlin dsl. I did the .kts decision a few month ago but not sure we really benefit from it. Anyways, I will to a small poc for manipulating build.gradle with rewrite via code outside of jhipster first.

@murdos murdos self-assigned this Jul 12, 2023
@atomfrede
Copy link
Member

I have a small sample using openrewrite. The idea would be to have a temp. rewrite.yml file which adds or removes dependencies and the rewrite step is executed via gradle + init script (which is also generated on the fly). But sadly, the gradle kotlin dsl is not supported yet, see here openrewrite/rewrite#3291

The sample can be found here https://github.com/atomfrede/open-rewrite-for-jhipster-lite-sample Its a standard maven project which adds dependencies to an "external" gradle project.

@murdos
Copy link
Contributor

murdos commented Sep 2, 2023

@pascalgrimaud
Copy link
Member

@murdos : approved, thanks for your work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: enhancement 🔧 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ generator: internal theme: gradle $500 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@murdos @atomfrede @pascalgrimaud @DamnClin and others