Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use eclim with gradle project

My eclim setup working perfectly with eclipse project. But I want to use gradle build system. I am working with Libgdx framework and it provide gradle templete project. So is there any way to use eclime + eclipse + gradle

like image 531
Natwar Singh Avatar asked Apr 06 '14 14:04

Natwar Singh


People also ask

How to run a Gradle project in Eclipse?

Create gradle project in eclipse and run the build. 1 1. Create java gradle project in eclipse. 2 2. Auto Generated files for Java gradle project in eclipse. 3 3. Run gradle build. 4 4. Run unit tests using gradle task. 5 5. Conclusion.

What are the fundamental elements of a Gradle build?

Learn about the fundamental elements of a Gradle build: projects, tasks, and the file API. If you are building software for the JVM, be sure to read about the specifics of those types of projects in Building Java & JVM projects and Testing in Java & JVM projects.

How do I use Gradle lifecycle tasks?

Run the task that you are interested in. Many convention-based builds integrate with Gradle’s lifecycle tasks, so use those when you don’t have something more specific you want to do with the build. For example, most builds have clean, check, assemble and build tasks.

How to run Gradle build and unit tests in Gradle?

Run gradle build In gradle tasks tab -> navigate to the project -> expand build folder -> right click on build -> Select Run Gradle tasks. 4. Run unit tests using gradle task


2 Answers

Your best bet is to check out the Eclipse Gradle plugin, although in short you can add apply plugin: 'eclipse' to your project and then run gradle eclipse from your terminal in the root folder of your project. That should generate the necessary files for Eclipse to recognize your project, although you might need to edit the .classpath file for proper autocompletions.

That will get Eclim to recognize your project with :ProjectOpen and proper autocompletion and other goodness.

The bad is that Gradle tasks and changes to your build.gradle will require manual changes to the Eclipse side of things.

Edit: There's a new plugin available for this purpose that replaces eclim for gradle projects (but is android oriented) called Vim-Grand. It's pre-alpha and you'll want the refactor branch for now, but it's working well enough for me

like image 161
Donnie West Avatar answered Oct 03 '22 08:10

Donnie West


You should combine it with YouCompleteMe.

What I did was use the gdx-setup.jar to create my project. I then imported it into eclipse like a normal gradle project. I closed eclipse and started up elcimd. Put "let g:EclimCompletionMethod = 'omnifunc'" in my .vimrc file. Followed the elcim instructions to use :CreateProject and that was it.

This guide was really helpful: http://www.lucianofiandesio.com/vim-configuration-for-happy-java-coding

like image 31
Hines Bourne Avatar answered Oct 03 '22 10:10

Hines Bourne