Gradle 5.0 Released with Java 11 Support
Java developers can now run Gradle builds with JDK 11. The latest milestone release of the popular open source build automation tool (Gradle 5.0) also comes with a production-ready Kotlin DSL, dependency version alignment, and task timeouts, among a long list enhancements and upgrades.
The true headline grabber in this release is the inclusion of Kotlin DSL 1.0. The Kotlin DSL (domain-specific language) provides an alternative syntax to the traditional Groovy DSL (originally introduced in the earliest versions of Gradle) through an "enhanced editing experience" in supported IDEs (according to the Gradle Kotlin DSL Primer). The Kotlin DSL is currently fully supported by two IDEs: IntelliJ IDEA and Android Studio, but other integrated development environments can import and work with Kotlin-DSL-based builds.
Authoring build logic using Kotlin provides "significant additional editing assistance in IDEs," the Gradle teams said in a blog post, "including: improved completion, error highlighting, and refactoring tools ... . "If you prefer the flexibility and dynamic features of Groovy, that's totally okay -- the Groovy DSL will not be deprecated," they added.
The introduction of dependency version alignment in Gradle 5.0 is also an attention getter in this announcement. This capability allows different modules belonging to the same logical "platform" or set of modules that "work together," either because they are published as a whole or because a test showed that they work together, as the Gradle Docs page explains it.
But Java jocks will be happy to learn about the JDK support in this release. The original Gradle plugin focused on Java, Groovy, and Scala, and it's still considered a leading build system for the JVM.
Gradle has always supported build automation across multiple languages and platforms, starting with Groovy, Java, and Scala, but now including Android and C/C++. The system is closely integrated with several development tools and continuous integration servers, including Eclipse, IntelliJ and Jenkins.
The Gradle team has published a detailed guide for developers who need to migrate older Gradle 4.x builds to Gradle 5.0. ("Keep in mind there are some breaking changes and considerations for any developer moving from 4.x up," they wrote.) There's also an installation guide available on GitHub for new developers who want to start using Gradle.
A one-hour, live webcast, "What's New in Gradle 5.0," featuring Gradle Developer Advocate Jenn Strater and Gradle Developer Experience Lead Eric Wendelin, is scheduled for Nov. 29. Register here.
Posted by John K. Waters on November 28, 2018