Gradle Release Notes

Version 1.0-milestone-6

  1. New and Noteworthy
    1. Faster dependency resolution
      1. Caching and caching timeouts for resolving dynamic versions
      2. Caching and caching timeouts for resolving changing modules
      3. Much faster resolves from Maven repositories
      4. What comes next
    2. Option to log test output to the console
    3. Option to fail dependency resolution on version conflict
    4. Password Protected Maven Repositories
    5. Publish artifacts other than archives
    6. Build announcements plugin
    7. Announce plugin improvements
    8. Daemon Improvements
    9. DSL Tweaks
    10. Upgraded to Groovy 1.8.4
  2. Fixed Jira Issues

New and Noteworthy

We are very happy with our speed of progress. We were able to deliver a decent chunk of important improvements and new features over the last couple of weeks. We are getting close to finish everything we consider as required for releasing 1.0.

Faster dependency resolution

Dependency resolution is overall faster in this release, and in some cases, very much faster.

To get into the details, we need to introduce some terminology. Feel free to skip to the next section if 'dependency resolution is faster' is a good enough explanation for you.

For a more detailed description of the changes below you may also have a look at this forum post.

Caching and caching timeouts for resolving dynamic versions

In previous Gradle versions, the default behavior for dealing with dynamic versions was to check for newer versions on every resolve. You could change this behavior by using some custom Ivy specific TTL system properties. We have implemented our own engine for dealing with this. By default cache entries expire in 24 hours. The user guide describes how to change this.

Caching and caching timeouts for resolving changing modules

If a dependency is flagged as changing, or a resolver tells us the module is changing (eg SNAPSHOT), we remember when we last fetched the module meta-data and artifacts. If we find a cache entry indicating it's ok to use the cached version, we use them. Otherwise, we check for changes to the descriptor and artifacts. Changing Module cache entries expire by default in 24 hours. The user guide describes how to change this.

Maven snapshots are always interpreted by Gradle as changing modules, also in the normal case when they have a timestamp. In the cache you will always only find a file foo-SNAPSHOT.jar. This is for Ivy legacy reasons. We will improve this in a future release.

Much faster resolves from Maven repositories

For reading from Maven repositories Gradle always delegated to the default Ivy resolve engine. We have now implemented our own resolve engine. This has dramatically reduced the number of HTTP requests when resolving dependencies from a Maven repository and thus dramatically improved the resolve performance.

What comes next

Performance is very dear to us. This release had a strong focus on avoiding any unnecessary network lookups. For example we had a lot of issues where the cache timeouts for Maven snapshots were not considered when using multiple repositories. This should be all solved now. For the next release we will do some work on improving the performance of cache lookups and do in-memory caching.

Option to log test output to the console

Gradle pays a lot of attention to provide a clean and concise console output, without unnecessary clutter that hides the important things. Therefore Gradle does not show the output of the tests on the console. This is still a very reasonable default behavior. So far the only way to see the test output was to look at the test reports. But there are scenarios where it is very helpful to see the test output directly. For example we have users with very slow running and somehow fragile tests. The test output serves here as a poor men progress bar as well as showing that nothing is stalled. This has been a very popular Jira ticket.

Now there is a simple way to simply switch on all test output on the console. You can also hook in a listener to have full control what test output is shown.

Option to fail dependency resolution on version conflict

By default, gradle uses 'newest' conflict resolution strategy. See the section about version conflicts in the user guide. Now you can also tell gradle to fail eagerly on version conflict. See the example here.

We plan to allow for custom version conflict resolution policies in the future.

Password Protected Maven Repositories

It is now possible to specify a username/password combination to access a maven repository protected with basic authentication. 
Previously, it was necessary to use special ivy properties to do this, and it wasn't possible to configure this on a per-repository basis.

The syntax for specifying credentials for accessing a maven repository is described here.

Publish artifacts other than archives

You can now easily publish any type of file. Previously, you could only publish archive files built by Gradle.

See the user guide for details.

Build announcements plugin

This plugin uses the announce plugin to generate announcements to the local desktop about interesting events in the build lifecycle. Very useful for longer builds, and with the \--continue command-line option. See the user guide for details of using it.

This plugin is currently experimental. It may change in future Gradle versions.

Announce plugin improvements

A new local announcer type has been added, which chooses an appropriate type based on the local platform for sending announcements to the local desktop.

The growl announcer no longer requires 'growl-notify' installed when running under the Apple JVM on Mac OS X.

Daemon Improvements

If you are using Gradle with the daemon enabled each build involves two JVM instances. One is the long running daemon JVM that actually executes the build. The other one is a JVM that is fired up for the time of a running build. This is what we call the build client. It triggers the execution of the build in the daemon JVM and is responsible for the console input and output.

The Gradle Daemon now correctly works with builds that accept input (e.g. a build prompting a user for a password). Previously, the Gradle Daemon was not able to access any input provided to the "client" process that initiated the build. This now works correctly and is completely transparent. 

The Gradle Daemon now respects the build clients Java version. This means that if an existing Gradle Daemon is available to service a build request, but is using a different Java version than what the build client is using, a new Gradle Daemon will be started with the desired Jave version.

DSL Tweaks

Project.files() now accepts a Task. Resolves to the output files of the task.

Upgraded to Groovy 1.8.4

Build scripts are now executed using Groovy 1.8.4 (instead of 1.7.10). Because Groovy does not guarantee binary backwards-compatibility between major versions, binary plugins written in Groovy may have to be recompiled to work with this Gradle version. This also holds for third-party plugins.

plus all above

Fixed Jira Issues

Jirra Issues
Type Key Summary Assignee Reporter Priority Status Resolved Created Uploaded Due
GRADLE-1923 Dependency resolution fails due to broken/missing version that has been evicted Unassigned Adam Murdoch Resolved Fixed 12/Nov/11 04/Jan/13
GRADLE-1922 Build announcements should not fail if notify-send is not in the path Adam Murdoch Adam Murdoch Resolved Fixed 12/Nov/11 04/Jan/13
GRADLE-1916 NPE when the version selected by conflict resolution does not exist Unassigned Adam Murdoch Resolved Fixed 10/Nov/11 04/Jan/13
GRADLE-1899 fail on version conflict Szczepan Faber Szczepan Faber Resolved Fixed 07/Nov/11 04/Jan/13
GRADLE-1898 Runtime dependency ignored when another dependency already depends on a different configuration of the same dependency which is processed first Unassigned Mauro Molinari Resolved Fixed 07/Nov/11 04/Jan/13
GRADLE-1897 Don't attempt to resolve static dependency which will be evicted Adam Murdoch Adam Murdoch Resolved Fixed 06/Nov/11 04/Jan/13
GRADLE-1896 Dependency exclusions not working in 1.0-milestone-6 Unassigned Kelly Robinson Resolved Fixed 05/Nov/11 04/Jan/13
GRADLE-1894 Gradle trying to download sources & javadocs for all dependencies results in a very slow build Unassigned raja chawat Resolved Fixed 04/Nov/11 04/Jan/13
GRADLE-1893 Gradle gradle-1.0-milestone-5 breaks testing of plugins not in the org.gradle package namespace Unassigned Frederick Staats Resolved Fixed 04/Nov/11 04/Jan/13
GRADLE-1892 Gradle build time should always print in UTC Luke Daley Luke Daley Resolved Fixed 04/Nov/11 04/Jan/13
GRADLE-1871 Parsing bug in org.gradle.wrapper.GradleWrapperMain Luke Daley Blaine Simpson Resolved Fixed 26/Oct/11 04/Jan/13
GRADLE-1853 Copying a configuration does not copy the exclude rules from parent configurations Luke Daley Luke Daley Resolved Fixed 20/Oct/11 04/Jan/13
GRADLE-1838 Artifacts are missing when meta-data declares multiple artifacts with same name, type and extension but different classifier Unassigned Adam Murdoch Resolved Fixed 16/Oct/11 04/Jan/13
GRADLE-1818 Allow stdin of client to be available via System.in when running in the daemon Unassigned Adam Murdoch Resolved Fixed 30/Sep/11 04/Jan/13
GRADLE-1781 Maven resolver does not find maven snapshots with uniqueVersion = true (which is the default value for the maven deployer) and latest selected Unassigned Ricardo Torres Resolved Fixed 03/Sep/11 04/Jan/13
GRADLE-1764 Default artifacts are not returned when combined with classifier artifacts when using flatdir repository Unassigned Daz DeBoer Resolved Fixed 24/Aug/11 10/Apr/14
GRADLE-1757 Changes to the java version specified in JAVA_HOME or PATH are not honoured when using the daemon Unassigned Adam Murdoch Resolved Fixed 20/Aug/11 04/Jan/13
GRADLE-1722 upgrade to groovy 1.8 Unassigned Adam Murdoch Resolved Fixed 04/Aug/11 04/Jan/13
GRADLE-1606 A different dependency is downloaded instead of the declared dependency Unassigned Claude Mamo Resolved Fixed 10/Jun/11 04/Jan/13
GRADLE-1478 Transitive dependency in classpath configuration of buildscript closure not excluded Unassigned Benjamin Muschko Resolved Fixed 16/Apr/11 04/Jan/13
GRADLE-1406 MissingMethodException: static org.gradle.ap i.internal.file.pattern.PatternMatcherFactory.getPatternMatcher() Unassigned Remon Sinnema Resolved Fixed 28/Feb/11 10/Apr/14
GRADLE-1333 Ivy: define a time to live (ttl) for dynamic revisions Unassigned Mathias Kalb Resolved Fixed 23/Jan/11 04/Jan/13
GRADLE-1322 Don't search for unused source and javadoc dependencies Daz DeBoer Joe Schmetzer Resolved Fixed 19/Jan/11 04/Jan/13
GRADLE-1237 Provide some way to publish artifacts which are not archives Unassigned Adam Murdoch Resolved Fixed 27/Nov/10 04/Jan/13
GRADLE-1184 SNAPSHOT modifier not working properly if more than one mavenRepo url is specified Unassigned lucas gray Resolved Fixed 20/Oct/10 04/Jan/13
GRADLE-1160 Access test output from TestDescriptor or TestResult Unassigned Nikita Skvortsov Resolved Fixed 30/Sep/10 04/Jan/13
GRADLE-1122 duplicate dependencies in build.gradle result in no dependecy in .classpath Unassigned Philip Crotwell Resolved Fixed 17/Aug/10 04/Jan/13
GRADLE-1038 Allow to specify a timeout interval for Maven snapshots. Unassigned Hans Dockter Resolved Fixed 16/Jul/10 04/Jan/13
GRADLE-1009 Allow configuration option for seeing test output on the console. Szczepan Faber Hans Dockter Resolved Fixed 25/Jun/10 04/Jan/13
GRADLE-735 No Non-Central Maven Repo Example Unassigned Robert Fischer Resolved Fixed 10/Nov/09 04/Jan/13
GRADLE-563 nicer way of accessing Maven password protected repositories Daz DeBoer Tomek Kaczanowski Resolved Fixed 21/Jul/09 04/Jan/13
GRADLE-240 Maven Snapshots are not properly resolved if there is more than one artifact repository Unassigned Hans Dockter Resolved Fixed 25/Sep/08 04/Jan/13

1.0-milestone-6 Migration Guide

Have a look at Gradle 1.0-milestone-6 Release Notes for more information about the new features in this release

  1. Known Issues
  2. Deprecations
    1. Deprecated API methods
    2. Repository DSL

Known Issues

There are some known issues in this release. They will be fixed in the next release of Gradle:

Deprecations

Some methods have been deprecated in this release. They continue to work in this release, but will be removed in a future Gradle release.

Deprecated API methods

On ResolvedArtifact

On MavenPluginConvention:

On Specs

Repository DSL

The old way of specifying userName and password to an ivy repository repositories.ivy has been deprecated in favour of a more structured, extensible syntax.
The new syntax looks like:

previous versions 1.0-milestone-6


repositories { 
    ivy {
        url 'http://...'
        userName 'me'
        password 'password'
    }
}                
            


repositories {
  ivy {
    url 'http://...'
 
    credentials {
      username 'me'
      password 'mypassword'
    }
  }
}                
            

Breaking Changes

Copy and archive tasks

The from() method used to accept a CopySpec. You should use with() instead:

previous versions

copy { from someSpec }

1.0-milestone-6

copy { with someSpec }

Announce plugin

Method announce() is now announce.announce()

previous versions

announce('title', 'message')

1.0-milestone-6

announce.announce('title', 'message')

Resolver API

RepositoryHandler.mavenRepo() now returns an instance of org.gradle.api.internal.artifacts.repositories.MavenResolver instead of a org.apache.ivy.plugins.resolver.DualResolver. MavenResolver is a subclass of org.apache.ivy.plugins.resolver.IBiblioResolver, with some special support for handling multiple artifact urls and Maven snapshots.

Transformer interface

The [org.gradle.util.Transformer|http://gradle.org/current/docs/javadoc/org/gradle/api/Transformer.html] interface is now capable of specifying an alternate return type, making it possible to transform an object into a different type. If you have an implementation of this interface in your build which looks like
 

Transformer transformer = new Transformer() {
  public String transform(String target) {
    /* transform */
  }
}

You'll need to change it to:



Transformer transformer = new Transformer() {
  public String transform(String target) {
    /* transform */
  }
}