Gradle 5.0, a new version of the software build tool for Java and Android development, is now available as a release candidate, offering the Kotlin Version 1.0 domain-specific language (DSL), Java 11 support, and dependency version alignment.
Gradle 5.0 provides an editing experience for Kotlin in its supported IDEs: JetBrains’s IntelliJ Idea and Google’s Android Studio. The DSL will make it easier to write build logic using the Kotlin language, with improved completion, error highlighting, and refactoring tools.
Version 5.0 adds support for running builds with Java Development Kit 11, the latest production version of Java SE.
Dependency version alignment lets different modules in the same group have identical versions in a dependency graph. Maven bills of materials can be imported to define platforms as well.
Other new features in Gradle 5.0
Other capabilities in Gradle 5.0 include:
- Task timeouts, through which developers can specify a duration for a task, after which it will be interrupted.
- Gradle can be started as a low-priority process, to ensure that other applications, such as the IDE or browser, stay responsive even when a demanding build is running.
- The JaCoCo plugin, providing code coverage metrics for Java code integration, works with the build cache. When applying this plugin without extra configuration, the test task stays cacheable; parallel test execution can be used.
- For writing plugins, an API has been added for creating
SourceDirectorySet
. Also, improvements have been made to theProvider
API and to build cache compatibility. MoreProvider
implementations track tasks that produce the value of the provider. - There are 159 fixes in Gradle 5.0, addressing issues such as missing include paths for MacOS frameworks to one in which the schema from named domain object containers changed during execution, exposing internal types.
- Among deprecations, the
interactive
andrecompileScripts
properties have been deprecated and will be removed in Gradle 6.0. - Java 8 is required as the minimum build JVM version, although developers still can use forked compilation and testing to build and test software for Java 6 and later. Also, the command line client now starts with 64M of heap instead of 1G, which could affect builds running directly inside the VM using
–no-daemon
mode.
Where to download the Gradle 5.0 release candidate
You can download the Gradle 5.0 release candidate at the Gradle.org release candidate webpage. Also, you can upgrade by updating wrapper properties: ./gradlew wrapper --gradle-version=5.0-rc-1
.