Gradle Release Notes

Version 6.6-milestone-2

The Gradle team is excited to announce Gradle 6.6-milestone-2.

This release features 1, 2, ... n, and more.

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

Danny Thomas, Daiki Hirabayashi, Sebastian Schuberth, Frieder Bluemle, Brick Tamland, Stefan Oehme, and Yurii Serhiichuk.

Table Of Contents

Upgrade Instructions

Switch your build to use Gradle 6.6-milestone-2 by updating your wrapper:

./gradlew wrapper --gradle-version=6.6-milestone-2

See the Gradle 6.x upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.6-milestone-2.

For Java, Groovy, Kotlin and Android compatibility, see the full compatibility notes.

Improved handling of ZIP archives on runtime classpaths

Runtime classpath analysis can now inspect manifest and META-INF properties files, ignore changes to comments, and selectively ignore attributes or properties that don't impact the runtime classpath.

normalization {
    runtimeClasspath {
        metaInf {
            ignoreAttribute("Implementation-Version")
            ignoreProperty("timestamp")
        }
    }
}

This improves the likelihood of build cache hits when jar and property files on the classpath are regenerated and only differ by unimportant values or comments.

See the userguide for further information. Note that this API is incubating and will likely change in future releases as support is expanded for normalizing properties files outside of META-INF.

Gradle module metadata can be made reproducible

The Gradle Module Metadata file contains a build identifier field which defaults to a unique ID generated during build execution. This results in the generated file being different at each build execution.

This value can now be disabled at the publication level, allowing users to opt-in for a reproducible Gradle Module Metadata file.

main(MavenPublication) {
    from components.java
    withoutBuildIdentifier()
}

See the documentation for more information on Gradle Module Metadata generation.

Variant-aware dependency substitution rules

Previously, it wasn't possible for Gradle to substitute a dependency which uses a classifier with a dependency without classifier, nor was it possible to substitute a dependency without classifier with a classified dependency. Similarly, dependencies with attributes (typically "platform" dependencies) or capabilities (typically "test fixtures" dependencies) could not be substituted.

Gradle now supports substitution of dependencies with classifiers, attributes or capabilities. Gradle's dependency substitution API has been enriched to cover those cases.

See the documentation on variant-aware substitution for details.

Improvements for plugin authors

Injectable ArchiveOperations service

Previously, it was only possible to create a FileTree for a ZIP or TAR archive by using the APIs provided by a Project. However, a Project object is not always available.

The new ArchiveOperations service has zipTree() and tarTree() methods for creating read-only FileTree instances respectively for ZIP and TAR archives.

See the user manual for how to inject services and the ArchiveOperations api documentation for more details and examples.

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.

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.

Reporting Problems

If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the forum.

We hope you will build happiness with Gradle, and we look forward to your feedback via Twitter or on GitHub.