Gradle Release Notes

Version 6.0

The Gradle team is excited to announce a new major version of Gradle, 6.0.

A major highlight of this release is the vastly improved feature set in dependency management. Some of the features were released in stages, but with Gradle 6.0 they are stable and production ready. We publish Gradle Module Metadata by default, which makes these new features available between projects and binary dependencies.

In the JVM ecosystem, we've made incremental Java and Groovy compilation faster, added support for JDK13 and provided out of the box support for javadoc and source jars. For Scala projects, we've updated the Zinc compiler and made it easier to select which version of Zinc to use.

For Gradle plugin authors, we've added new APIs to make it easier to lazily connect tasks and properties together, made useful services available to worker API actions and Gradle will complain at runtime if a task appears misconfigured.

In the native ecosystem, we've added support for Visual Studio 2019 and the latest C++ standards.

This release contains some updates to help protect the integrity and security of your build.

As always, we also incorporated some smaller changes and many other fixed issues.

This release features changes across the board, but these release notes only list what's new since Gradle 5.6. You can review the highlights since Gradle 5.0 here.

We would like to thank the following community contributors to this release of Gradle:

Nathan Strong, Roberto Perez Alcolea, Daniel Santiago, Tetsuya Ikenaga, Sebastian Schuberth, Andrey Mischenko, Shintaro Katafuchi, Alex Saveau, Mike Kobit, Tom Eyckmans, Artur Dryomov, szhem, Nigel Banks, Sergey Shatunov, Dan Sănduleac, Vladimir Sitnikov, Ross Goldberg, jutoft, Robin Verduijn, Pedro Tôrres, Michael Berry, Evgeny Mandrikov, lingocoder, Robert Stupp, and Predrag Knežević.

Upgrade Instructions Switch your build to use Gradle 6.0 by updating your wrapper: ./gradlew wrapper --gradle-version=6.0 See the upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.0. Compatibility Notes A Java version between 8 and 13 is required to execute Gradle. Java 14 and later versions are not yet supported. Java 6 and 7 can still be used for compilation and forked test execution. Just like Gradle 5.x, any supported version of Java can be used for compile or test. This version of Gradle is tested with Android Gradle Plugin 3.4, 3.5 and 3.6

Kotlin 1.3.21 through 1.3.50 Other versions may or may not work.

Faster incremental Java and Groovy compilation When analyzing the impact of a changed class, the incremental compiler can now exclude classes that are an implementation detail of another class. This limits the number of classes that need to be recompiled. For instance, if you have: class A {} class B { static void foo () { A a = new A (); } } class C { void bar () { B . foo (); } } When A is changed, Gradle previously recompiled all 3 source files, even though B did not change in a way that required C to be recompiled. In Gradle 6.0, Gradle will only recompile A and B . For deep dependency chains, this may greatly reduce the number of files that require recompilation within a compilation task. If A , B and C were all in different projects, Gradle would skip recompiling C through compilation avoidance. This was contributed by Robert Stupp.

Support for Java 13 Gradle now supports running with Java 13.

The Zinc compiler has been upgraded to version 1.3.0. Gradle no longer supports building for Scala 2.9. This fixes some Scala incremental compilation bugs and improves performance. The minimum Zinc compiler supported by Gradle is 1.2.0 and the maximum tested version is 1.3.0. To make it easier to select the version of the Zinc compiler, you can now configure a zincVersion property: scala { zincVersion = "1.2.1" } Please note that the coordinates for the supported version of Zinc has changed since Zinc 1.0. If you try to use the com.typesafe.zinc:zinc compiler, Gradle will switch to the new Zinc implementation with a default version (1.3.0). This was originally contributed by Predrag Knežević.

Problems with tasks called out during build Tasks that define their inputs or outputs incorrectly can cause problems when running incremental builds or when using the build cache. As part of an ongoing effort to bring these problems to light, Gradle now reports these problems as deprecation warnings during the build. When issues are detected, Gradle will show warnings when run with --warning-mode=all : > Task : myTask Property 'inputDirectory' is declared without normalization specified . Properties of cacheable work must declare their normalization via @ PathSensitive , @ Classpath or @ CompileClasspath . Defaulting to PathSensitivity . ABSOLUTE . This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0 . Property 'outputFile' is not annotated with an input or output annotation . This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0 . Deprecation warnings will always show up in build scans regardless of the command-line arguments used. See the user manual for how to address these deprecation warnings.

Usability improvements Automatic shortening of long command-lines for Java applications on Windows When Gradle detects that a Java process command-line will exceed Windows's 32,768 character limit, Gradle will attempt to shorten the command-line by passing the classpath of the Java application via a "classpath jar". The classpath jar contains a manifest with the full classpath of the application. Gradle will only pass the generated jar on the command-line to the application. If the command-line is still too long, the Java process will fail to start as before. If the command-line does not require shortening, Gradle will not change the command-line arguments for the Java process. More consistent & robust file deletion on Windows Deleting complex file hierarchies on Windows can sometimes fail with errors like Unable to delete directory ... . In the past, Gradle has used workarounds in some but not all cases when deleting files. Gradle now deletes files in a consistent way that should avoid failures when cleaning output files of a task. Windows line endings: gradle init generates .gitattributes file To ensure Windows batch scripts retain the appropriate line endings, gradle init now generates a .gitattributes file. This was contributed by Tom Eyckmans. Wrapper reports download progress as percentage Gradle now reports the progress of the distribution downloaded. Initially contributed by Artur Dryomov. Wrapper tries to recover from an invalid Gradle installation If the wrapper determines a Gradle distribution installed by the wrapper is invalid, the wrapper will attempt to re-install the distribution. Previous versions of the wrapper would fail and require manual intervention. When logging messages to the Gradle daemon log, our log format only contain the time and not the date. Gradle now logs with ISO-8601 date timestamps.

Features for native developers IntelliSense support for C++17 and latest C++ standard within Visual Studio Gradle will now generate IDE solutions honoring the C++17 /std:cpp17 and latest C++ standard /std:cpplatest compiler flags. Visual Studio IntelliSense will help you write great code with these new standards. Support for Visual Studio 2019 Gradle now supports building application and libraries with Visual Studio 2019.

Features for Gradle tooling providers Test output as progress event Users of the latest Tooling API can listen to the new TestOutputEvent progress event type that contains the test output. With that, tooling providers can use the TestLauncher API to launch tests and show the test output on the fly.

Promoted features Promoted features are features that were incubating in previous versions of Gradle but are now supported and subject to backwards compatibility. See the User Manual section on the “Feature Lifecycle” for more information. The following are the features that have been promoted in this Gradle release. C++ and Swift support We promoted all the new native plugins (i.e. cpp-application , cpp-library , cpp-unit-test , swift-application , swift-library , xctest , visual-studio and xcode ). Note that all software model plugins will be phased out instead of being promoted. New incremental tasks API The new InputChanges API for implementing incremental tasks has been promoted. See the user manual for more information. IDE integration types and APIs. We promoted all API elements in ide and tooling-api sub-projects that were introduced before Gradle 5.5. Some long existing incubating features have been promoted All pre-5.0 incubating APIs have been promoted.

The lazy configuration API has been promoted.

Enabling strict task validation has been promoted.

Fixed issues

Known issues Known issues are problems that were discovered post release that are directly related to changes made in this release.

External contributions We love getting contributions from the Gradle community. For information on contributing, please see gradle.org/contribute.