Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Content assist for gradle

I'm trying to do a small project with Gradle in order to get familiar with it. I have a lot of Maven experience, so the basics seem obvious.

However, I'm having problems with the tooling. My questions is: Is there a proper Content Assist for .gradle files for Eclipse?

I tried STS, which claims it has gradle support, but when I create a new gradle project, I got a NoClassDefFoundError. So I installed a gradle plugin, I also installed Groovy (after a bunch of failed attempts I found the right version), and now I have coloring, but no content assist. I also tried Buildship - same thing. STS appears to have had "Enable DSL" for gradle in a previous version (2.9), but that option is no longer available, or I can't find it.

In short - I've tried multiple options and none of them offered a way to explore the gradle syntax, as for example an XSD-supporting XML editor would do for Maven.

like image 728
Bozho Avatar asked Dec 25 '15 20:12

Bozho


2 Answers

I know this question is old and I'm a little late, but I ran into this StackOverflow question while google searching. There is now an Eclipse plugin that supports content assist, tooltips, parse error handling, etc. It's called EGradle. The version I downloaded is 1.3.0 and as far as I know it supports Eclipse Neon and up. Hope this helps anyone in the future that happens to stop by here...

like image 97
Sal_Vader_808 Avatar answered Oct 14 '22 06:10

Sal_Vader_808


My questions is: Is there a proper Content Assist for .gradle files for Eclipse?

Short answer is "No". As far as I know there is nothing.

The new BuildShip plugin doesn't provide editor support and as far as I know they have no plans in the near future to put work into that.

STS gradle plugin used to have a "Enable DSL Support" option, as you mention, but that option was removed because it was very very limited in what it actually could do and at the same time was a bit of a maintenance nightmare.

The Groovy Eclipse plugins provide some support for working with general .groovy code, but:

  • has no specific support for gradle
  • doesn't work well with .gradle files because it relies on project's classpath which is not the same as the classpath for the build script
  • is no longer being maintained by anyone.

There is one plugin you might want to try out. The minimalist gradle editor. I haven't tried it myself and I don't think it does content assist, but it might be your best bet at getting a little bit of support for editing .gradle files.

like image 31
Kris Avatar answered Oct 14 '22 07:10

Kris