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

✨ Gradle support #591

Closed
wants to merge 7 commits into from
Closed

✨ Gradle support #591

wants to merge 7 commits into from

Conversation

jmle
Copy link
Contributor

@jmle jmle commented Apr 26, 2024

(#598) Adds support for fetching dependencies with Gradle projects.

  • This implementation assumes that there is a Gradle wrapper included in the project, otherwise it is not possible to know which Gradle version is needed.
  • To maximize compatibility with most Gradle versions, JDK8 must be used. There are a number of ways to specify this on newer Gradle versions, but for older versions the only thing that seems to work is setting JAVA_HOME.
  • Depends on Gradle support java-analyzer-bundle#93

❗ This PR does not provide support for fetching dependency sources yet.

🟢 Tested against https://github.com/andyjduncan/gradle-example and https://github.com/kissaten/gradle-multi-project-example

@jmle jmle changed the title Gradle support ✨ Gradle support Apr 26, 2024
Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

From a quick scan the code looks good to me.

Can we add one of these example projects to the examples and add the output to the demo output so that we can get some basic e2e testing as well?

@jmle jmle requested a review from shawn-hurley May 2, 2024 08:44
Copy link
Contributor

@pranavgaikwad pranavgaikwad left a comment

Choose a reason for hiding this comment

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

small nits / questions...overall looks great!

demo-dep-output.yaml Outdated Show resolved Hide resolved
func (p *javaServiceClient) GetDependencies(ctx context.Context) (map[uri.URI][]*provider.Dep, error) {
if p.getBuildTool() == gradle {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this redundant given that there's a switch in GetDepenenciesDAG()? I think we will need to move fallback call inside GetDepenciesDAG()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's a good idea to have the check here too, mainly because both GetDependencies and GetDependenciesDAG are public, so they could both be called independently

@jmle jmle force-pushed the gradle-support branch 2 times, most recently from 21000b1 to 0a753ec Compare May 20, 2024 15:18
jmle added 7 commits May 21, 2024 13:04
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
@jmle jmle force-pushed the gradle-support branch from 0258f98 to a15b697 Compare May 21, 2024 11:21
@jmle jmle mentioned this pull request May 23, 2024
@jmle jmle closed this May 23, 2024
@jmle jmle reopened this May 23, 2024
@jmle
Copy link
Contributor Author

jmle commented May 23, 2024

Superseded by #609

@jmle jmle closed this May 23, 2024
jmle added a commit that referenced this pull request Jun 3, 2024
👀 See [Gradle support
enhancement](https://github.com/konveyor/enhancements/blob/master/enhancements/gradle-support/README.md)

(#598) Adds support for
fetching dependencies with Gradle projects.
(#599) Adds support for
downloading dependency sources.

- This implementation assumes that there is a Gradle wrapper included in
the project, otherwise it is not possible to know which Gradle version
is needed.
- To maximize compatibility with most Gradle versions, JDK8 must be
used. There are a number of ways to specify this on newer Gradle
versions, but for older versions the only thing that seems to work is
setting `JAVA_HOME`.

:exclamation: This PR supersedes
#591

🟢 Tested against
https://github.com/andyjduncan/gradle-example and
https://github.com/kissaten/gradle-multi-project-example

---------

Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
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