Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Gradle 4.2 Is Released

Gradle 4.2 Is Released

Gradle recently released version 4.2 of their build tool, featuring some major additions. One significant addition is parallel task execution for native compilation and linking tasks. InfoQ asked Eric Wendelin, principal engineer at Gradle, about this feature:

Gradle's worker API provides a mechanism for executing tasks in parallel; this reduces overall build time by maximizing CPU utilization. The worker API is used in Gradle 4.2 to execute C/C++/Swift compilation and linking tasks by default. In other words, parallel task execution is on by default for only native tasks, and not yet on by default for other technologies like Java, though I should note that some Gradle plugins are using this to parallelize work for their ecosystem.

Wendelin added that existing projects will benefit from upgrading to the latest version as Gradle 4.2 provides improved performance, notably for the projects that use remote script plugins. Gradle 4.2 also provides faster build cache unpacking and builds that process archives with zipTree and tarTree.

The following chart from the Gradle website shows the performance improvements in v4.2 over v4.1

Gradle 4.2 includes a few new APIs for plugin authors, including nested DSL elements, declaring the output of a task as a publish artifact, and Groovy DSL support for properties of type PropertyState. According to Wendelin:

Most notable are a new ObjectFactory API for creating nested DSL elements and a DSL expansion to allow a plugin author to declare a given file or directory as an output of a project.

Other notable features of 4.2 are enhancements to Kotlin DSL, support for Google Cloud Storage repositories, and support for Play v2.6, custom Twirl templates and on-demand rebuild for PlayRun tasks.

Support for running Gradle on Java 7 is deprecated and will be removed in Gradle 5.0.

Rate this Article