Seamlessly integrating Gradle into Eclipse

Buildship 2.2 brings major improvements, Java 9 support

Jane Elizabeth
© Shutterstock / Nataliia Budianska

Big improvements are in store for Buildship, the effort to incorporate Gradle into Eclipse. Buildship 2.2 boasts improved runtime classpath separation, Java 9 support, and more.

Buildship is the official Gradle integration for Eclipse. It helps Eclipse users synchronize Gradle builds with their workspace and can execute tasks without leaving their IDE. Buildship 2.2 brings all sorts of interesting new improvements for users, including runtime classpath separation, Java 9 support, syntax highlighting for Gradle, improved automatic project synchronization, and more.

It’s been a while since we last checked in with Buildship. In the meantime, this project has grown considerably. The latest update has a whole bunch of improvements. What’s on offer?

Runtime classpath separation

In previous releases for Buildship, there was no defined separation for the Eclipse runtime classpath. So when a user launched any Java applications or tested something with the JDT, then all of the dependencies from all configurations were available on the classpath.

Now, Buildship 2.2 has runtime classpath separation based on the dependency scope information supplied by Gradle. With projects using Gradle 4.4 or higher, then all source directories and binary dependencies define to which scope they belong to. Then, Buildship filters the elements from the runtime classpath if the launched app is associated with a different scope.

However, it’s important to remember that Buildship still has to use Eclipe’s default flat classpath approach. This means that this feature can only filter unwanted dependencies based on their scopes. However, by doing so, this allows other third party plugins like the Spring Tool Suite to work better with Gradle projects.

SEE MORE: Buildship into the future

Java 9 compatibility

It’s been a little while since Java 9 finally arrived. Compatibility is key, especially since Gradle managed Java 9 support a month ago. Now, Buildship works if the host Eclipse is running on Java 9, too. This version has updated any incompatible dependencies. New checks in the build infrastructure verifiy if there are any errors with the latest Java release.

Syntax highlighting for Gradle script files

Gradle build files are now opened in a dedicated Gradle editor which provides basic syntax highlighting.

Buildship

SEE MORE: Eclipse JDT Language Server Project

Automatic project synchronization

Now, when a build script changes, Eclipse can be configured to execute Gradle project synchronization automatically. The feature can be enabled in the import wizard or in the workspace and project preferences.

Buildship

Streamlining task and executions view

If users want to follow the platform recommendations, the expand and collapse actions on the view toolbars have been updated. Now, they work on the entire tree and not just on the selected elements. Moreover, double-clicking on non-leaf tree items expands-collapses the subtree.

 

Buildship

Buildship

SEE MORE: Gradle’s Java 9 support explained

Where to get Buildship 2.2

Builship 2.2 can be downloaded here directly from the Eclipse website or on GitHub.

Author
Jane Elizabeth
Jane Elizabeth is an assistant editor for JAXenter.com

Comments
comments powered by Disqus