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
3 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

- 55
- 7
-
But where are routes for classpaths? – Jesus Bejarano May 17 '14 at 04:15
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

- 600
- 1
- 7
- 20
-
How do you run your android/desktop project from vim. Can you please tell me more, how you use `:CreateProject`. Because it is multi-module project. Did I need to do it with every module. – Natwar Singh May 09 '14 at 19:01
-
I map
g to build from within VIM which basically runs ./gradlew desktop:run. Like this: nnoremap – Hines Bourne May 10 '14 at 01:42g system('./gradlew desktop:run') You can of course map many if you are building android or whatever. The 2 links I provided to YouCompleteMe and lucianofiandesio are very detailed and should suit your needs. I basically have 1 libgdx project with the android/ios/desktop in one folder and run the :CreateProject inside there. -
I got about build command but still confused in :CreateProject. Should I consider all models as a single project and use `:CreateProject` in parent folder. Or I need to do it in all three(android/ios/desktop) modules separately. – Natwar Singh May 11 '14 at 15:55
-
-
@HinesBourne Did yoy manage to get the auto-completation and validation working? – Jesus Bejarano May 17 '14 at 04:13
-
Yes, Jesus. I followed both YouCompleteMe and http://www.lucianofiandesio.com/vim-configuration-for-happy-java-coding and was able to get it working. – Hines Bourne May 17 '14 at 13:13
-
I've been working on this as well. I am finding I need to import my project and use 'build model' within the Eclipse UI. Once that is done, I can kill eclipse UI and start eclimd, and everything works as expected including :JavaImportOrganize. I'm working now on doing the import and build model from the command line, so I never have to open Eclipse. – ether_joe Dec 28 '14 at 09:48
I am able to get most or all Eclim functionality working with my libgdx project this way:
- create a new libgdx project with their tools
- start Eclipse
- Import --> Gradle Project --> Build Model per usual libgdx project creation
- shut off Eclipse, start Eclim
I get organize imports, java validation, autocompletion, all the good stuff.
That said, I want to figure out how to do this all without having to use Eclipse. I think the missing piece is the Build Models functionality. Still researching ...

- 1,068
- 1
- 13
- 32