BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Gradle 7.0 Released with Support for JDK 16

Gradle 7.0 Released with Support for JDK 16

This item in japanese

Lire ce contenu en français

Gradle, the customizable open source build automation tool, has released version 7.0. This release comes with support for JDK 16, faster incremental builds, improved build reliability with validation errors, and native support for new Macs with Apple Silicon processors. In addition, some of the preview features like JVM toolchains, dependency locking, dependency verification, and support for Java Module System, introduced in earlier releases, have all been promoted as stable features in version 7.0.

Prior versions of Gradle would not run on the latest JDK 16. However, with the help of the JVM toolchains, and by disabling incremental compilation, one could still build their Java projects using JDK 16. With the latest 7.0 release of Gradle, both running Gradle and building projects on JDK 16 is fully supported. Gradle itself has been upgraded to use Groovy 3 in Groovy based DSL build scripts to fully support JDK 16. Groovy 3 is packed with new features and capabilities that also support interoperability with newer Java features. Note that Groovy 2 and Groovy 3 aren’t fully compatible with each other and as a result may cause issues when upgrading to Gradle 7.0. Consult Gradle’s upgrade instructions for further guidance.

Each release of Gradle continues to bring speed improvements to incremental builds. This release enables the optimized file system watching feature by default on all supported platforms like Windows, Linux, and MacOS. The optimization helps Gradle to learn about the changes to the build input and output files and retain that info in memory between builds. This allows Gradle to skip reading from the file system on each build thereby reducing the amount of disk I/O needed to determine the input and output file changes between builds.

Another build speed improvement was delivered in this release by ignoring empty buildSrc folders. Prior to this release, presence of a buildSrc folder would force Gradle to execute all related tasks potentially causing build cache misses and an additional performance overhead. Gradle will now ignore empty buildSrc folders thereby skipping execution of unnecessary tasks and avoiding cache misses.

One of the prominent stable features of Gradle 7.0 release is the full support for the Java module system. Users can now build, test, and run Java modules via Gradle. The mere presence of module-info.java will let Gradle infer that your jar is a module and has to be put on the modulepath instead of the traditional classpath.

Plugin development improvements like support for plugins with multiple variants, using included builds for local plugins, fixes for security advisories, dependency locking improvements, the experimental version catalogs, and type safe project accessors are some of the other noteworthy improvements and features in Gradle 7.0.

Rate this Article

Adoption
Style

BT