Skip to content

Releases: gradle/gradle

3.2 RC2

31 Oct 17:34
Compare
Choose a tag to compare
3.2 RC2 Pre-release
Pre-release

Gradle 3.2 RC2 is now available for testing

This release candidate contains a few bug fixes reported against 3.2 RC1.

  • GRADLE-3575: IndexOutOfBoundsException is thrown when building task execution graph
  • GRADLE-3577: REPLACED file change type breaks compatibility with existing plugin
  • GRADLE-3576: Child specs in Copy tasks cannot be modified when the Copy task is already running
  • GRADLE-3573: Improvements to JANSI can't initialize if java.io.tmpdir is mounted with noexec

Check the release notes for more information. If no regressions are reported, a final release will typically follow in the next week.

Upgrade Instructions

Switch your build to use Gradle 3.2 RC2 quickly by updating your wrapper properties:

./gradlew wrapper --gradle-version=3.2-rc-2

Standalone downloads are available at https://gradle.org/release-candidate.

Reporting Problems

If you find a problem with Gradle 3.2 RC2, 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.

3.2 RC1

24 Oct 20:33
Compare
Choose a tag to compare
3.2 RC1 Pre-release
Pre-release

Gradle 3.2 RC1 is now available for testing

It's a relatively quiet release this time around, but there are still plenty of reasons to upgrade.

Perhaps the most significant improvements are in the incremental build support, which now has better up-to-date checking for Java compilation, copying, and archiving. You can also have Gradle treat any task input as a classpath with the new @Classpath annotation.

Users of Gradle's native build support gain an important tool in this release. Many of you will be familiar with the buildDependents task for classic multi-project builds. This is now available in native builds as well via new assembleDependents and buildDependents tasks. These are incredibly useful for determining whether your changes have adversely impacted anything that depends on them.

If you use an IDE and have a lot of dependencies in your build—particular dynamic ones—you may have experienced long import times. The underlying issue has been fixed in this release, resulting in significantly improved import times. One example enterprise build showed a 100-fold improvement!

Our users trialling the Kotlin build script support will be glad to hear that progress continues apace with support for multi-project builds. And it's easier to try this feature on Windows now that a bug in compiling scripts on that platform has been fixed.

The last change we want to bring to your attention has been a long time coming and will affect a large number of builds: the shortcut syntax for declaring tasks (via <<) has now been deprecated. The eagle-eyed among you will notice that the user guide examples have been updated to use doLast() and we strongly recommend that you follow suit. This feature will be removed in Gradle 5.0! See the deprecations section of the release notes for more details.

Check the 3.2 RC1 release notes for more information. If no regressions are reported, a final release will typically follow in the next week.

Upgrade Instructions

Switch your build to use Gradle 3.2 RC1 quickly by updating your wrapper properties:

./gradlew wrapper --gradle-version=3.2-rc-1

Standalone downloads are available at https://gradle.org/release-candidate.

Reporting Problems

If you find a problem with Gradle 3.2 RC1, 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.

3.1

19 Sep 11:28
13f38ba
Compare
Choose a tag to compare
3.1

Gradle 3.1 is now available

Multi-project builds are a powerful feature with one significant constraint: the projects have to be in the same directory hierarchy. This doesn't help if you want to work on code across multiple repositories, for example if you're trying to fix a bug in a third-party open-source library that one of your projects depends on.

Gradle 3.1 now supports this scenario with the introduction of Composite Builds for all users. It's hard to understate just how important this feature is as it provides a whole new way of organizing your projects and builds. There is more work to be done in this area and the feature is currently incubating, but we encourage you to try it out and give us your feedback!

Incremental Build is a similar feature in terms of impact and this release improves the control you have over its up-to-date checks. You can read about the details in the release notes.

As with many previous Gradle releases, you will also benefit from some performance improvements, this time in the form of faster dependency resolution. From testing, Android users specifically could see up to a 50% reduction in configuration and Android Studio sync time (v2.2+ only).

Build cancellation has improved when using the Daemon. Cancelling a build with Ctrl-C after the first build no longer terminates the Gradle Daemon.

Our Play Framework and Kotlin build script users will also be happy as 3.1 now has (limited) support for Play 2.5.x and the Kotlin build script support gets a more fully-featured syntax for declaring dependencies and faster code completion.

Finally, be sure to check out the potential breaking changes in case they affect you.

Check the 3.1 release notes for more information.

Upgrade Instructions

Switch your build to use Gradle 3.1 quickly by updating your wrapper properties:

./gradlew wrapper --gradle-version=3.1

Standalone downloads are available at https://gradle.org/gradle-download.

Reporting Problems

If you find a problem with Gradle 3.1, please create a new topic in the Bugs category of the Gradle Forum. Be sure to include which operating system you are using, the version of Gradle you upgraded from and any steps you have found that reproduces your problem.

3.1 RC1

12 Sep 12:58
v3.1.0-RC1
Compare
Choose a tag to compare
3.1 RC1 Pre-release
Pre-release

Gradle 3.1 RC1 is now available for testing

Multi-project builds are a powerful feature with one significant constraint: the projects have to be in the same directory hierarchy. This doesn't help if you want to work on code across multiple repositories, for example if you're trying to fix a bug in a third-party open-source library that one of your projects depends on.

Gradle 3.1 now supports this scenario with the introduction of Composite Builds for all users. It's hard to understate just how important this feature is as it provides a whole new way of organizing your projects and builds. There is more work to be done in this area and the feature is currently incubating, but we encourage you to try it out and give us your feedback!

Incremental Build is a similar feature in terms of impact and this release improves the control you have over its up-to-date checks. You can read about the details in the release notes.

As with many previous Gradle releases, you will also benefit from some performance improvements, this time in the form of faster dependency resolution. From testing, Android users specifically could see up to a 50% reduction in configuration and Android Studio sync time.

Our Play Framework and Kotlin build script users will also be happy as 3.1 now has (limited) support for Play 2.5.x and the Kotlin build script support gets a more fully-featured syntax for declaring dependencies and faster code completion.

Finally, be sure to check out the potential breaking changes in case they affect you.

Check the 3.1 RC1 release notes for more information. If no regressions are reported, a final release will typically follow in the next week.

Upgrade Instructions

Switch your build to use Gradle 3.1 RC1 quickly by updating your wrapper properties:

./gradlew wrapper --gradle-version=3.1-rc-1

Standalone downloads are available at https://gradle.org/release-candidate.

Reporting Problems

If you find a problem with Gradle 3.1 RC1, please post a reply to this topic or create a new topic in the Bugs category of the Gradle Forum. Be sure to include which operating system you are using, the version of Gradle you upgraded from and any steps you have found that reproduces your problem.

3.0

19 Sep 11:33
ad76ba0
Compare
Choose a tag to compare
3.0

Gradle 3.0 Release Notes

Version 3.0

The Gradle team is pleased to announce Gradle 3.0.

Performance continues to be a focus for the Gradle team and the third major release reflects this. The Gradle Daemon is a key performance enhancer, making builds up to 75% faster, but it needed to be explicitly enabled in previous versions of Gradle. This is no longer necessary as the Daemon is now enabled by default in 3.0. We've put a lot of effort into fixing the most significant issues with the Gradle Daemon, especially on Windows platforms. We have also been working hard to make the Gradle Daemon aware of its health and impact to the system it's running on and use this information for self-healing actions as well as better daemon status reporting. The Gradle Daemon is the foundation for a great Gradle experience.

Ever wished for better IDE support when writing Gradle build scripts? This release provides the first support for Gradle Script Kotlin, which is a Kotlin-based build language for Gradle scripts. Its deep integration with both IDEA and Eclipse provides many of the things you would expect from an IDE such as auto-completion, refactoring, navigation to source, and more. Groovy is still the primary build language for Gradle scripts and will always be supported, but we are working intensely to make Gradle Script Kotlin fully production ready by the end of the year in order to provide the best possible development experience to Gradle users. See Chris Beams's blog post for more information about this exciting new feature.

Additionally, Gradle 3.0 provides support for running on the latest Java 9 EAP builds. Users can also build and run tests using these early versions of JDK 9, but there are some limitations. Check out the section on Java 9 support below for more details.

With the release of Gradle 3.0, it's a good time to reflect on the progress we've made over the last 2 years. Check out some of the improvements since Gradle 2.0. Lots of reasons to upgrade!

We're also pleased to make available a draft of our new Performance Guide. This is intended to be a short guide that shows you how to dramatically improve your build performance in the time it takes to eat lunch. Check it out and please provide any feedback via the guide's GitHub Issues.

New and noteworthy

Here are the new features introduced in this Gradle release.

Improved Gradle Daemon, now enabled by default

As mentioned above, the Gradle Daemon is now more robust, efficient and self-aware. It has now been enabled by default to make your builds faster than ever. If for some reason you encounter problems, it can always be disabled if necessary.

View the status of Gradle Daemons

Before Gradle 3.0, there was no easy way to determine the status of a running Gradle Daemon or why a Daemon might have stopped. With this release, you can now check the status of running and recently stopped daemons using the --status command and get better insight into the state your Gradle environment.

$> gradle --status
   PID STATUS   INFO
 43536 BUSY     3.0
 43542 IDLE     3.0
 43418 STOPPED  (stop command received)
 43366 STOPPED  (stop command received)

Note that the status command currently does not list Gradle Daemons with version < 3.0. More details are available in the User Guide.

View Daemon information in Gradle Cloud Services

Information about the Gradle Daemon is now being captured in your Build Scans and can be viewed in Gradle Cloud Services. You can see information such as the number of builds that have been run in the Daemon, the number of Daemons that were running on the system when the build occurred, as well as reasons for why a Daemon may have been stopped. Along with all of the other great information in a Build Scan, this captures the state of the Daemon at the time a build executes and gives you insight into factors that might have affected that build's performance. If you haven't created a Build Scan yet, give it a try!

Better IDE support for writing build scripts

The Gradle team and JetBrains have been collaborating to provide the best possible IDE support for writing Gradle build scripts. Gradle 3.0 supports version 0.3.0 of
Gradle Script Kotlin, a statically typed build language based on Kotlin.

So what does a Gradle Script Kotlin build look like? Here's an example:

import org.gradle.api.tasks.*

apply<ApplicationPlugin>()

configure<ApplicationPluginConvention> {
    mainClassName = "org.gradle.samples.HelloWorld"
}

repositories {
    jcenter()
}

dependencies {
    compile("commons-lang:commons-lang:2.4")
    testCompile("junit:junit:4.12")
}

task<Copy>("copyConfig") {
    from("src/main/conf")
    into("build/conf")
    exclude("**/*.old")
    includeEmptyDirs = false
}

This looks very similar to a Groovy build script, but when you load it in either IDEA or Eclipse, suddenly development is a much better experience. You now have code auto-completion, refactoring, and other features you would expect from an IDE in your build.gradle.kts. You can still use all of your plugins written in Java or Groovy but also take advantage of the power of first-class development support. Take a look and give it a try!

We'll continue to enhance this support in future versions of Gradle, so if you discover any issues, please let us know via the project's GitHub Issues.

Parallel task execution improvements

Gradle 3.0 makes it easier to manage the resources that Gradle uses. The Test task type now honors the max-workers setting for the test processes that are started. This means that Gradle will now run at most max-workers tasks and test processes at the same time.

If you need to return to the old behavior, you can limit the number of forked processes:

tasks.withType(Test) {
     maxParallelForks = 1
}

Initial Java 9 support

Gradle 3.0 contains initial support for running Gradle on Java 9 as well as compiling, testing and running Java 9 applications from Gradle.

Preliminary support for the JDK 9 -release compiler flag has been added as well. It can be specified via compilerArgs, e.g.

compileJava.options.compilerArgs.addAll(['-release', '7'])

The following plugins have known issues with Java 9:

When using continuous build on Java 9, the following constraints apply due to class access restrictions related to Jigsaw:

  • On Mac OS X, Gradle will poll for file changes every 10 seconds instead of every 2 seconds.
  • On Windows, continuous build may be slow to detect changes on very large projects.

Additionally, when publishing to S3 backed Maven and Ivy repositories, -addmods java.xml.bind will have to be added to the JVM parameters when using Java 9.

GRADLE_OPTS="-addmods java.xml.bind '-Dorg.gradle.jvmargs=-addmods java.xml.bind'"

Please report any issues you may experience running or building with Java 9 on the Gradle Forums.

Improved plugins DSL

There are times when it might be useful to resolve a plugin without actually applying it to the current project, for example:

  • When you only want to reuse a task class from the plugin
  • When you only want to apply the plugin to subprojects of the current project

Previously, this could only be done with the buildscript DSL syntax, but this is now possible via the plugins DSL, too:

plugins {
    id 'my.special.plugin' version '1.0' apply false
}

subprojects {
    if (someCondition) {
        apply plugin 'my.special.plugin'
    }
}

Note the apply false at the end of the plugin declaration. This instructs Gradle to resolve the plugin and make it available on the classpath, but not to apply it.

Incremental build improvements

Tracking changes in the task's code

A task is up-to-date as long as its inputs and outputs remain unchanged. Previous versions of Gradle did not consider the code of the task as part of the inputs. This could lead to incorrect behavior where the implementation of a task could change but the task might still be marked as UP-TO-DATE even though it would actually create different outputs. Gradle now recognizes when a task, its actions, or its dependencies change between executions and properly marks the task as out-of-date.

New task property annotations

Since 3.0, every task property should specify its role via one of the task property annotations:

  • an input or output of the task (@Input, @Nested, @InputDirectory, @OutputFile etc.)
  • an injected service (@Inject)
  • a property that influences only the console output of the task (the new @Console annotation)
  • an internal property that should not be considered for up-to-date checks (the new @Internal annotation)

When using the java-gradle-plugin, a warning is printed during validation for any task property that is not anno...

Read more

3.0 RC2

08 Aug 17:44
e1df465
Compare
Choose a tag to compare
3.0 RC2 Pre-release
Pre-release

Gradle 3.0-rc-2 is now available for testing

This release fixes a few issues reported against 3.0-rc-1.

  • Some deprecations were reverted related to methods accepting closures
  • Fix to incremental Java compilation
  • Allow access to Settings DSL from buildscript block to ensure backwards compatibility

Check the 3.0-rc-2 release notes for more information. If no regressions are reported, a final release will typically follow in the next week.

Upgrade Instructions

Switch your build to use Gradle 3.0-rc-2 quickly by updating your wrapper properties:

./gradlew wrapper --gradle-version=3.0-rc-2

Standalone downloads are available at https://gradle.org/release-candidate.

Reporting Problems

If you find a problem with Gradle 3.0-rc-2, please post a reply to this topic or create a new topic in Bugs. Be sure to include which operating system you are using, the version of Gradle you upgraded from and any steps you have found that reproduces your problem.

3.0 RC1

02 Aug 06:49
v3.0.0-RC1
Compare
Choose a tag to compare
3.0 RC1 Pre-release
Pre-release

General Notes

Gradle 3.0 is just around the corner! We have lots of new features to share with you since 2.14 and we'd love for you to give it a shot and submit feedback. See Getting Started and Providing Feedback sections below for details.

But wait, there's more! We couldn't list all of the "little" things we've improved in Gradle 3.0 here, you'll want to check the detailed release notes for the full list.

New Features and Improvements

  • The Gradle Daemon is now enabled by default. According to our testing, we can achieve a 15-75% speed improvement in subsequent builds in most projects, just by enabling the Gradle Daemon. We have worked hard to make it robust and resource-aware so that everyone can use it.
  • Initial Java 9 Support. Gradle now runs properly when run on the latest JDK 9 EAP builds, and users can build and run tests for their own projects against JDK 9 as well. Note, however, that Gradle does not yet support deep integration with Jigsaw modules or -modulepath.
  • Gradle build scripts can now be written in Kotlin. Kotlin is a statically-typed programming language for the JVM with rich IDE support. Gradle 3.0 includes Gradle Script Kotlin v0.3.0. Many capabilities of Groovy build scripts are now available, see the Gradle Script Kotlin v0.3.0 release notes for details.
  • New Performance Guide. We're pleased to make available a draft of our new Performance Guide. This is a 13-page guide that allows you to dramatically improve your build performance over the course of an afternoon. Take a look and suggest improvements through GitHub Issues.
  • Lots more An improved plugins {} DSL, more robust incremental and --parallel builds, enhancements to the codenarc, eclipse-wtp, jacoco, osgi, pmd plugins and more are described in the full release notes.

Deprecations and Removals

To keep technology moving forward, we are removing support for the following:

  • Running Gradle on Java 6 is no longer supported. Gradle itself now requires Java 7 or better to run, but compiling project sources and running tests with Java 6 remains supported. See the cross-compilation for Java 6 section of the user guide for details.
  • Compiling and testing with Java 5 is no longer supported.
  • Many features deprecated in the Gradle 2.x line have been removed. See the detailed release notes.

Getting Started

Set your Gradle wrapper version to 3.0-rc-1 as follows:

$ cd $YOUR_GRADLE_PROJECT
$ gradle wrapper --gradle-version 3.0-rc-1

Then run the wrapper to trigger download and installation:

$ ./gradlew --version
Downloading https://services.gradle.org/distributions/gradle-3.0-rc-1-bin.zip
....................................................................................
....................................................................................
------------------------------------------------------------
Gradle 3.0-rc-1
------------------------------------------------------------
[...]

Now continue to operate the build via the ./gradlew wrapper as you normally would and experiment with the new features as you go.

Providing Feedback

If you believe you've found an issue with Gradle 3.0 RC1 or simply have a question about it, please:

  • Post a topic in the Bugs category of the Gradle Forums
  • Provide a Build Scan, if possible, or paste the output of ./gradlew --version so we can see relevant OS and JDK information
  • Bugs submitted with a small example that reproduces the problematic behavior are more likely to be fixed quickly

3.0 M2

21 Jun 23:31
v3.0.0-M2
Compare
Choose a tag to compare
3.0 M2 Pre-release
Pre-release

General Notes

This second milestone leading up to Gradle 3.0 builds on 3.0 M1 with several key improvements listed below.

Give 3.0 M2 a try for yourself. See the Getting Started and Providing Feedback sections below for details.

For more information, see the announcement blog post and detailed release notes.

A Note About Compatibility and Support

This release is intended as a preview for new features we'll be releasing soon in Gradle 3.0. As such, it is not intended to be used in a production environment and features may change significantly before they are released in Gradle 3.0.

New Features and Improvements since 3.0 M1

  • Initial Java 9 Support. Gradle now runs properly when run on the latest JDK 9 EAP builds, and users can build and run tests for their own projects against JDK 9 as well. Note, however, that Gradle does not yet support Jigsaw modules or JDK 9-specific compile options such as -release and -modulepath.
  • Performance Improvements and new Performance Guide. A number of performance improvements have acculmulated over the last several Gradle releases, and it's a good time to try them out for yourself in 3.0 M2. For details on many of these improvements, see Cédric's blog post. We're also pleased to make available a draft of our new Performance Guide. This is intended to be a short (13-page) guide that allows you to dramatically improve your build performance over the course of an afternoon. Check it out and please provide any feedback via the guide's GitHub Issues.
  • Improved Kotlin build scripting. Gradle 3.0 M2 includes the newly-released Gradle Script Kotlin 0.2.0. Users can now modify the build script classpath and apply plugins in Kotlin-based build scripts, and project import into IDEA is now seamless. See the Gradle Script Kotlin 0.2.0 release notes for details, samples and getting started instructions.

Getting Started

Set your Gradle wrapper version to 3.0-milestone-2 as follows:

$ cd $YOUR_GRADLE_PROJECT
$ gradle wrapper --gradle-version 3.0-milestone-2

Then run the wrapper to trigger download and installation:

$ ./gradlew --version
Downloading https://services.gradle.org/distributions/gradle-3.0-milestone-2-bin.zip
....................................................................................
....................................................................................
------------------------------------------------------------
Gradle 3.0-milestone-2
------------------------------------------------------------
[...]

Now continue to operate the build via the ./gradlew wrapper as you normally would and experiment with the new features as you go.

Providing Feedback

If you believe you've found an issue with Gradle 3.0 M2 or simply have a question about it, please:

  • Post a topic in the 3.0 M2 feedback category of the Gradle Forums
  • Paste the output of ./gradlew --version so we can see relevant OS and JDK information
  • Provide, if possible, a small example that reproduces the problematic behavior

3.0 M1

09 Jun 18:00
v3.0.0-M1
Compare
Choose a tag to compare
3.0 M1 Pre-release
Pre-release

General Notes

This release is the first in a short series of milestones leading up to Gradle 3.0 GA. Its purpose is to gather feedback on each of the major changes listed below.

We encourage all Gradle users to give 3.0 M1 a try and let us know how it goes. See the Getting Started and Providing Feedback sections below for details.

For more information, please see the announcement blog post and detailed release notes.

New Features and Improvements

  • The Gradle Daemon is now enabled by default. The Gradle Daemon is a long-running background process that dramatically improves Gradle command line responsiveness and overall build times. Prior to this release, the daemon had been an opt-in feature, requiring users to enable it explicitly. Now the daemon is enabled by default, meaning it is no longer necessary to provide the --daemon option or to set the org.gradle.daemon property to true.
  • Gradle build scripts can now be written in Kotlin. Kotlin is a statically-typed programming language for the JVM with rich IDE support. This release introduces initial support for writing Gradle build scripts in Kotlin, enabling the use of autocompletion, quick documentation, refactoring and other key IDE features. See the announcement blog post and Gradle Script Kotlin 1.0 M1 release notes for complete details, samples and getting started instructions.

Caveats and Limitations

  • Features deprecated in the Gradle 2.x line have been removed. See the latest (Gradle 2.13) deprecation list for details.
  • Running Gradle on Java 6 is no longer supported. Gradle itself now requires Java 7 or better to run, but compiling project sources and running tests with Java 6 remains supported. See the cross-compilation for Java 6 section of the user guide for details.

Getting Started

The best way to try out 3.0 M1 is against a real-world project whose build you are already familiar with.

Set your Gradle wrapper version to 3.0-milestone-1 as follows:

$ cd $YOUR_GRADLE_PROJECT
$ gradle wrapper --gradle-version 3.0-milestone-1

Then run the wrapper to trigger download and installation:

$ ./gradlew --version
Downloading https://services.gradle.org/distributions/gradle-3.0-milestone-1-bin.zip
....................................................................................
....................................................................................
------------------------------------------------------------
Gradle 3.0-milestone-1
------------------------------------------------------------
[...]

Now continue to operate the build via the ./gradlew wrapper as you normally would and experiment with the new features as you go.

Providing Feedback

If you believe you've found an issue with Gradle 3.0 M1 or simply have a question about it, please:

  • Post a topic in the 3.0 M1 feedback category of the Gradle Forums
  • Paste the output of ./gradlew --version so we can see relevant OS and JDK information
  • Provide, if possible, a small example that reproduces the problematic behavior