Gradle build sharing comes out of the cradle

The build automation system's founder also wants to address feature creep with CI systems

Gradle, the popular build automation system perhaps best known for its use in Android mobile app development, is set to formally add distributed cache capabilities later this year, for deploying shared builds.

"With a distributed cache, builds are no longer isolated; the output of a build can be shared among developers," said Hans Dockter, who developed Gradle and is CEO of Gradle Inc. "That's a key feature for making builds -- especially when you have bigger teams -- much faster," he said when interviewed at a Silicon Valley Java User Group meeting this week.

While the distributed cache already exists as an experimental feature, a production-ready version is projected for fourth-quarter general availability, possibly in Gradle 3.3. In a 2015 blog post, Dockter said the base concept of a distributed cache is that every task is a deterministic function from input to output. "In the case of compilation, for example, the input is not only the source code, but also the version and the type of compiler, and the OS being used," he said. "When all of those parameters are captured, the cache output can be reliably shared across machines."

Dockter also noted "feature creep" between build tools like Gradle and continuous integration (CI) systems like Jenkins, which overlap in functions like report generation and integration testing. A CI product needs to support different build systems, and some build systems have deficiencies, so a system like Gradle can add functionality that developers can use in lieu of the CI product, he said. While CI merges code from multiple developers, a tool like Gradle can automate the building of applications from code.

Gradle 3.0, featuring faster builds, was released on Aug. 15 and adds JetBrains' Kotlin language as an option for scripting, which gets initial support in the 3.0 release. Previously, this capability was reserved for a Groovy DSL, which is still supported. Dockter noted that Kotlin is more suitable for IDE support, is scripting-friendly, and is statically compiled, so it's easier to maintain complex build logic.

While Kotlin has been enabled in Gradle, it is not yet stable, and Kotlin-based Gradle builds written now might not work with the next version of Gradle. The feature is expected to be stabilized and production-ready by the end of the year. Gradle earlier this week also gained a capability to execute builds of Python code via LinkedIn's open source {py}gradle plugin.


EmoticonEmoticon