Gradle Release Notes

Version 1.0-milestone-8

  1. New and Noteworthy
    1. New code quality plugins
      1. Standalone Checkstyle and CodeNarc plugins
    2. Dependency resolution
      1. Offline switch for dependency resolution
      2. Refresh switch for dependency resolution
      3. New user guide section on the dependency cache
      4. Changing module (SNAPSHOT) artifacts are correctly downloaded when changed
      5. Support for NTLM proxy authentication
    3. Daemon improvements
    4. Tooling API improvements.
      1. Chapter on embedding Gradle.
      2. Tooling Api thread safety.
      3. Tooling API offers more configurability.
      4. Tooling API informs about the build environment.
    5. Improvements to signature generation
    6. Other Changes
      1. Gradle Wrapper supports proxy authentication
      2. Plugin and task implementation
        1. Added {{@OutputDirectories}} and {{@OutputFiles}} annotations
        2. Added {{ExtensionContainer.add(name, type, args...)}}
      3. Reporting abstraction
  2. Fixed Jira Issues

New and Noteworthy

New code quality plugins

Gradle now includes several new code quality plugins, thanks to a contribution by Andrew Oberstar:

Standalone Checkstyle and CodeNarc plugins

The existing code quality plugin has been split up into a separate Checkstyle plugin and CodeNarc plugin. These plugins also now allow you to specify which version of Checkstyle or CodeNarc you'd like to use for the analysis.

Dependency resolution

Offline switch for dependency resolution

Gradle 1.0-milestone-8 introduces an "\--offline" switch, that tells Gradle to always use dependency artifacts from the cache, regardless if they are due to be checked again. When running with \--offline, Gradle will not attempt to access the network to perform dependency resolution. If required artifacts are not present in the dependency cache, build execution will fail.

At this time, external scripts that are included via apply from: are not cached, so are not helped by \--offline. This is something we intend to address soon.

Refresh switch for dependency resolution

At times, the Gradle dependency cache can be out of sync with the actual state of the configured repositories. Perhaps a repository was initially misconfigured, or perhaps a "non-changing" module was published incorrectly. To refresh all dependencies in the dependency cache, use the new "\--refresh dependencies" option on the command line.

The "\--refresh dependencies" option tells Gradle to ignore all cached entries for resolved modules and artifacts. A fresh resolve will be performed against all configured repositories, with dynamic versions recalculated, modules refreshed, and artifacts downloaded. However, where possible Gradle will attempt to verify if the previously downloaded artifacts are valid before downloading again. This is done by comparing published SHA1 values in the repository with the SHA1 values for previously downloaded artifacts.

New user guide section on the dependency cache

This section describes in some detail the design and behaviour of the Gradle dependency cache.

Changing module (SNAPSHOT) artifacts are correctly downloaded when changed

In Gradle 1.0-milestone-7 there was an issue that meant Gradle did not always download the changed artifacts for a changing module, regardless of the cacheChangingModulesFor setting. This has been fixed in Gradle 1.0-milestone-8.

Before downloading a new copy of a changing module artifact, Gradle will check the published SHA1 key against the currently downloaded version. This means that SHA1 key files are essential to avoid Gradle downloading these artifacts on every build execution.

Support for NTLM proxy authentication

Gradle is now able to resolve dependencies when HTTP access is via a proxy that requires NTLM authentication via the standard http.proxyUser and http.proxyPassword system properties.

If your proxy requires NTLM authentication, you may need to provide the authentication domain as well as the username and password.
There are 2 ways that you can provide the domain for authenticating to a NTLM proxy:

Daemon improvements

Tooling API improvements.

Chapter on embedding Gradle.

It largely covers the fundamental ideas behind the Tooling API and I would really recommend to read that if you are into embedding Gradle. We've also added many samples to the Tooling API javadocs. Check out the chapter here or check out the javadocs for tooling API starting from its main entry point: GradleConnector.

Tooling Api thread safety.

We've fixed some outstanding problems with the Tooling API thread safety. Combined with some daemon fixes it increases the quality of the Tooling API.

Tooling API offers more configurability.

See examples in javadocs for BuildLauncher or ModelBuilder.

Tooling API informs about the build environment.

It is possible to acquire information about the build environment like the java home, jvm arguments or the gradle version. The gradle version information is available on any target Gradle version. Complete build environment information is available for target gradle version > milestone-7. Take a look at information and samples in the docs for BuildEnvironment.

Improvements to signature generation

Some improvements have been made to the signing plugin to make it easier to configure builds that only need to generate signatures sometimes.

In almost all cases, it's as simple as:


signing {
  required = !version.endsWith("SNAPSHOT")
}

When signing is not required and the signing configuration is missing (i.e. the necessarily credentials to generate signatures) any signing tasks will be skipped. For publication, this means that the signatures will just not be generated and uploaded. Likewise, when signing is not required the signPom() method that is used in maven deployments will not error if it cannot generate a signature.

For situations where you may not know until execution time if signing is required, you can assign a closure to the required property.


signing {
  required = { gradle.taskGraph.hasTask(uploadArchives) && !version.endsWith("SNAPSHOT") }
}

Other Changes

Gradle Wrapper supports proxy authentication

The gradle wrapper now supports authenticated proxies via the standard JVM proxy properties ( http://gradle.org/docs/current/userguide/tutorial_this_and_that.html#sec:accessing_the_web_via_a_proxy). For this to work, add a gradle.properties file as described, either in the root directory of your project, or in your Gradle home directory.

Plugin and task implementation

Added @OutputDirectories and @OutputFiles annotations

These annotations are analagous to the task.outputs.dirs() and task.outputs.files() API methods. The annotations can be applied to any property whose type is compatible with Iterable<File> (e.g. FileCollection, List<File>).

For @OutputDirectories, each item is ensured to be created as a directory before the task executes. For @OutputFiles, each item's parent directory is ensured to be created before the task executes.

Added ExtensionContainer.add(name, type, args...)

This method of adding extensions results in an extension being added that itself is extensions aware. This will eventually replace the ExtensionContainer.add(String, Object) method.

Here's an example:


import org.gradle.api.plugins.ExtensionAware

class MyExtension {
  String name
  Project project
  MyExtension(String name, Project project) {
    this.name = name
    this.project = project
  }
}

project.extensions.add("foo", MyExtension, "foo", project)
project.foo.extensions.add("bar", MyExtension, "bar", project)

assert project.foo instanceof MyExtension
assert project.foo instanceof ExtensionAware

assert project.foo.bar instanceof MyExtension
assert project.foo.bar instanceof ExtensionAware

Reporting abstraction

Some new model elements have been introduced to provide a standardise way to model report generation. The javadoc for the new classes can be found here.

Tasks that generate reports implement the Reporting interface which allows configuration like the following:


codenarcMain {
  reports {
    xml.enabled = false
    text {
      destination "$build/codenarcMain.txt"
    }
    html {
      enabled = true
    }
  }
}

At the moment, only the new code quality related tasks have been updated to this new mechanism.

Fixed Jira Issues

Jirra Issues
Type Key Summary Assignee Reporter Priority Status Resolved Created Uploaded Due
GRADLE-2165 Dependencies added after projects are evaluated are not included by the tooling API Unassigned Kris De Volder Resolved Fixed 12/Mar/12 04/Jan/13
GRADLE-2150 Problem sending mail from a build script Adam Murdoch Gradle Forums Resolved Fixed 06/Mar/12 04/Jan/13
GRADLE-2095 Allow signing.required to be set with a callable to make it easier to defer this decision Unassigned Luke Daley Resolved Fixed 10/Feb/12 04/Jan/13
GRADLE-2093 signPom() should do nothing if !signing.required and signing can't be done (e.g. no signatory) Luke Daley Luke Daley Resolved Fixed 09/Feb/12 04/Jan/13
GRADLE-2091 signing { required = false } is not honoured. Luke Daley Luke Daley Resolved Fixed 09/Feb/12 04/Jan/13
GRADLE-2089 Cannot use daemon with ibm jvm Unassigned Adam Murdoch Resolved Fixed 08/Feb/12 04/Jan/13
GRADLE-2085 Could not create task of type 'Test' Unassigned Gradle Forums Resolved Fixed 07/Feb/12 04/Jan/13
GRADLE-2080 Configuration done in gradle.projectsEvaluated { } ignored by tooling API Adam Murdoch Adam Murdoch Resolved Fixed 03/Feb/12 04/Jan/13
GRADLE-2073 Documentation on "Managing domain objects" in custom plugin section needs updating to the new plugin.extensions syntax René Gröschke Matias Bjarland Resolved Fixed 30/Jan/12 04/Jan/13
GRADLE-2062 1.0-milestone-7 does not support NTLM proxy authentication Daz DeBoer Gradle Forums Resolved Fixed 24/Jan/12 04/Jan/13
GRADLE-2061 Using mavenLocal() is very slow in Milestone 7 Daz DeBoer Gradle Forums Resolved Fixed 24/Jan/12 04/Jan/13
GRADLE-2060 gradle.user.home on the command-line is ignored René Gröschke Daz DeBoer Resolved Fixed 24/Jan/12 04/Jan/13
GRADLE-2057 Add project.fileTree(Object, Closure) method for consistency with project.files(Object..., Closure) Luke Daley Luke Daley Resolved Fixed 20/Jan/12 04/Jan/13
GRADLE-2052 Cannot use dom4j from task action attached to built-in task Unassigned Gradle Forums Resolved Fixed 17/Jan/12 04/Jan/13
GRADLE-2051 Convention mapping does not work for primitive properties Adam Murdoch Adam Murdoch Resolved Fixed 17/Jan/12 04/Jan/13
GRADLE-2047 can't access dependency files from inside configuration.incoming.afterResolve hook Luke Daley Luke Daley Resolved Fixed 14/Jan/12 04/Jan/13
GRADLE-2040 Reduce log levels for the Tooling API Szczepan Faber Gradle Forums Resolved Fixed 11/Jan/12 04/Jan/13
GRADLE-2035 Error running tests in milestone 6 Szczepan Faber Gradle Forums Resolved Fixed 06/Jan/12 04/Jan/13
GRADLE-2028 SimpleHttpConnectionManager being used incorrectly. Daz DeBoer Philip Crotwell Resolved Fixed 05/Jan/12 04/Jan/13
GRADLE-2027 Milestone 6 fails to recognize fetched dependencies and then fails fetch dependencies from Nexus repository Daz DeBoer Moritz Dietsche Resolved Fixed 05/Jan/12 04/Jan/13
GRADLE-2024 A PropertiesFileContentMerger should exist similar to XmlFileContentMerger Unassigned Andrew Oberstar Resolved Fixed 03/Jan/12 04/Jan/13
GRADLE-2022 Error message when a user tries to use a directly instantiated task does not provide any information Luke Daley Luke Daley Resolved Fixed 03/Jan/12 04/Jan/13
GRADLE-2014 Display a proper icon in OSX's dock when running the gradle command Adam Murdoch Andres Almiray Resolved Fixed 23/Dec/11 04/Jan/13
GRADLE-2010 DefaultProjectDependency_Decorated cannot be cast to ExternalModuleDependency Adam Murdoch Anders Viskum Resolved Fixed 21/Dec/11 04/Jan/13
GRADLE-2007 Gradle does not handle http responses with content-encoding = gzip Daz DeBoer Denis Zhdanov Resolved Fixed 19/Dec/11 04/Jan/13
GRADLE-2006 Calling Project.getProperties() may emit deprecation messages Luke Daley Yoav Landman Resolved Fixed 19/Dec/11 04/Jan/13
GRADLE-1967 Accessing public method Project.getProperties after applying the maven plugin generates misleading warnings Luke Daley Blaine Simpson Resolved Fixed 27/Nov/11 04/Jan/13
GRADLE-1961 Silently fails to retrieve relocated artifacts Daz DeBoer Blaine Simpson Resolved Fixed 24/Nov/11 04/Jan/13
GRADLE-1941 Strange exception in while executing wrapper task Adam Murdoch Joern Huxhorn Resolved Fixed 18/Nov/11 04/Jan/13
GRADLE-1934 Multiple classifiers in Maven dependency ignored Unassigned MikeN Resolved Fixed 16/Nov/11 04/Jan/13
GRADLE-1921 Add Support for Findbugs, JDepend, and PMD Unassigned Andrew Oberstar Resolved Fixed 11/Nov/11 04/Jan/13
GRADLE-1907 Avoid unnecessary dependency downloads through checksum comparison Daz DeBoer Chris Beams Resolved Fixed 09/Nov/11 04/Jan/13
GRADLE-1887 checkstyle*.ignoreFailures = true Unassigned Chris Jones Resolved Fixed 03/Nov/11 04/Jan/13
GRADLE-1844 Idea plugin: Using a pathVariable breaks library references René Gröschke Adrian Abraham Resolved Fixed 19/Oct/11 04/Jan/13
GRADLE-1842 Resolution does not fail when dependency with classifier refers to an artifact that does not exist Unassigned Adam Murdoch Resolved Fixed 18/Oct/11 04/Jan/13
GRADLE-1840 The Javadoc task doesn't handle custom taglets correctly Unassigned Dumitru Daniliuc Resolved Fixed 17/Oct/11 04/Jan/13
GRADLE-1823 Running gradlew wrapper on windows puts windows backslashes in unix gradlew file Unassigned Paul King Resolved Fixed 10/Oct/11 04/Jan/13
GRADLE-1815 Passing a closure to Project.fileTree() yields a FileTree that always resolves to zero files Luke Daley Peter Niederwieser Resolved Fixed 29/Sep/11 04/Jan/13
GRADLE-1800 Tooling API: Sporadic model-build failures because of LinkedList.remove => NoSuchElementException Szczepan Faber Kris De Volder Resolved Fixed 20/Sep/11 04/Jan/13
GRADLE-1774 Gradle truncates values of system and project properties passed from the command line if they contain an equals sign René Gröschke Peter Niederwieser Resolved Fixed 31/Aug/11 04/Jan/13
GRADLE-1688 Officially document tooling api Szczepan Faber Szczepan Faber Resolved Fixed 25/Jul/11 04/Jan/13
GRADLE-1679 gradlew does not support HTTP proxy authentication Daz DeBoer Matt Stine Resolved Fixed 20/Jul/11 04/Jan/13
GRADLE-1563 Javadoc Plugin does not generate correct command line options for tags and targlets Peter Niederwieser Howard M. Lewis Ship Resolved Fixed 19/May/11 04/Jan/13
GRADLE-1556 Gradle does not support proxy authentication using user/password system properties Daz DeBoer Daniel Beck Resolved Fixed 17/May/11 25/Jun/13
GRADLE-1544 Quality Plugin: Be able to declare codenarc version Unassigned Hamlet D'Arcy Resolved Fixed 14/May/11 01/May/13
GRADLE-1496 sonar task fails with java.lang.OutOfMemoryError: PermGen space Unassigned Joern Huxhorn Resolved Fixed 27/Apr/11 04/Jan/13
GRADLE-1442 possible problem when single artifact is referenced in dependencies with different classifiers Unassigned Szczepan Faber Resolved Fixed 14/Mar/11 04/Jan/13
GRADLE-1240 Need a way to set JVM memory args for the Gradle Daemon Unassigned Chris Brookes Resolved Fixed 01/Dec/10 04/Jan/13
GRADLE-1049 updated remote snapshot artifact during multiproject build causes exception Daz DeBoer René Gröschke Resolved Fixed 22/Jul/10 04/Jan/13
GRADLE-629 Snapshot dependencies are not updated Daz DeBoer Peter Niederwieser Resolved Fixed 09/Sep/09 04/Jan/13
GRADLE-600 Excessive dependency download of SNAPSHOT Daz DeBoer Jeppe Nejsum Madsen Resolved Fixed 20/Aug/09 04/Jan/13
GRADLE-320 Gradle should work in offline mode to load classes from the local cache Unassigned Marko Bauhardt Resolved Fixed 08/Dec/08 04/Jan/13