Monday, February 3, 2014

Getting Gradle integrated into Eclipse

It was nice learning Gradle, but I felt it'd be a bit more convenient to have Gradle inside the Eclipse IDE. Gradle is already present in the Netbeans IDE, but for Eclipse you have to install it like so:

This project at Github is what you need: https://github.com/spring-projects/eclipse-integration-gradle

From the documentation on the website, just follow the same steps:
  • Open the Eclipse IDE
  • Select Help > Install new software
  • Paste a Gradle update site link (http://dist.springsource.com/release/TOOLS/gradle) into the "Work with" text box. 
  • Ensure that the option "Group Items by Category" is enabled.
  • Select the top-level node 'Extensions / Gradle Integration'.
  • Click "Next".
  • Review the list of software that will be installed. Click "Next" again.
  • Review and accept licence agreements and Click "Finish".
It'll take a while to install:


Now in Project Explorer, right click on your project, go to Run As > 2. Gradle... to run the project under whichever tasks you want to select.


You don't always have to return to this dialog box. The next time, you can simply run the selected tasks using Run As > 1. Gradle.
If you add any tasks externally, click the refresh button to view that task.

It's that simple. Happy building! :)

No comments: