Pre-release
Pre-release

@marcphilipp marcphilipp released this Oct 2, 2018 · 3344 commits to master since this release

Assets 2

The Gradle team is pleased to announce Gradle 5.0 Milestone 1.

We are excited to share some great new features and improvements with you in this release:

First and foremost, Gradle Kotlin DSL is now production-ready with it's 1.0 release! Authoring your build logic using Kotlin provides significant additional editing assistance in IDEs, including: improved completion, error highlighting, and refactoring tools. Please follow our migrating build logic from Groovy to Kotlin guide if you're interested. If you prefer the flexibility and dynamic nature of Groovy, that's totally okay — the Groovy DSL will never be deprecated.

You can now specify a timeout duration for a task, after which it will be interrupted. Read more about task timeouts in the docs.

Next up, this version of Gradle introduces dependency version alignment. This allows different modules belonging to the same logical group (platform) to have identical versions in a dependency graph. Maven BOMs can be imported to define platforms as well.

dependencies {
    // import a BOM. The versions used in this file will override any other version found in the graph
    implementation(dependencies.enforcedPlatform("org.springframework.boot:spring-boot-dependencies:1.5.8.RELEASE"))
        
    // define dependencies without versions
    implementation("com.google.code.gson:gson")
    implementation("dom4j:dom4j")
    
    // this version will be overriden by the one found in the BOM
    implementation("org.codehaus.groovy:groovy:1.8.6")
}

Moving on, gradle init functionality has been upgraded in this release: is now optionally interactive, includes new kotlin-library and kotlin-application project types, provides options for configuring project and package names, and more.

init

This release introduces useful changes for plugin and custom task authors, including an API for creating SourceDirectorySets, improvements to the Provider API, and improved build cache compatibility.

Finally, because this is a new major version of Gradle, many of the things that were deprecated in the Gradle 4.x versions have been removed. For example, running Gradle now requires Java 8 or higher (though tests can be run using Java 6 or 7). It is recommended that you

  • read the upgrading from Gradle 4.x to 5.0 document
  • upgrade to Gradle 4.10.2
  • run gradle help --scan and look at the "Deprecations" view
  • you can also use gradle help --warning-mode=all, though it may not report as much detailed information

to find and fix all deprecated build logic.

deprecations-build-scans

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

Upgrade Instructions

Switch your build to use Gradle 5.0 Milestone 1 quickly by updating your wrapper properties:

./gradlew wrapper --gradle-version=5.0-milestone-1

Standalone downloads are available at https://services.gradle.org/distributions/.

Reporting Problems

If you find a problem with Gradle 5.0 Milestone 1, 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.