Gradle Release Notes

Version 3.0-milestone-1

Table Of Contents

New and noteworthy

Here are the new features introduced in this Gradle release.

Improvements since Gradle 2.0

Improved Gradle Daemon, now enabled by default

The performance improvement gained by using the Daemon is staggering: our performance tests show that builds could be up to 75% faster, just by enabling the Gradle Daemon.

We have been working hard to make the Gradle Daemon aware of its health and impact on the system it's running on; and we believe that it is now robust enough to be enabled by default.

We encourage you to give the improved Daemon a try. If for some reason you encounter problems, you can disable the Daemon. Please submit feedback to us if you encounter instability so that we can make further improvements.

Delayed configuration of task inputs and outputs

A configure() method with an Action or Closure parameter was added to both TaskInputs and TaskOutputs to allow configuring the task's inputs and outputs directly before the task is to be executed.

Up-to-date checks more robust against task implementation changes

Previously if a task's implementation class name changed, the class was deemed out-of-date even if its inputs and outputs matched the previous execution. However, if only the code of the task, or a dependent library changed, the task was still considered up-to-date. Since this version Gradle notices if the code of a task or its dependencies change between executions, and marks tasks as out-of-date when needed.

Improved handling of external dependencies in eclipse-wtp plugin

Before Gradle 3.0, the eclipse-wtp plugin always defined external dependencies the WTP component descriptor. This caused several problems, listed at GRADLE-2123. To resolve this, the plugin now defines external dependencies in the Eclipse classpath and marks them as deployed/non-deployed accordingly. For each library a classpath entry similar to the one below is generated:

<classpathentry kind="lib" path=/path/to/lib-1.0.0.jar" exported=“false">
    <attributes>
        <attribute name="org.eclipse.jst.component.dependency" value="WEB-INF/lib"/>
    </attributes>
</classpath>

If the project is not a Java project (and thus has no classpath), the dependencies are added to the component descriptor as before.

Improved dependency resolution for eclipse-wtp plugin

The eclipse-wtp plugin now fully leverages Gradle's dependency resolution engine. As a result, all dependency customisations like substitution rules and forced versions work in WTP projects.

eclipse plugin also applies eclipse-wtp for web projects

If a project applies the war or ear plugins, then applying the eclipse plugin also applies eclipse-wtp. This improves the out-of-the box experience for Eclipse Buildship users.

Promoted features are features that were incubating in previous versions of Gradle but are now supported and subject to backwards compatibility. See the User guide section on the “Feature Lifecycle” for more information.

The following are the features that have been promoted in this Gradle release.

Fixed issues

Deprecations

Features that have become superseded or irrelevant due to the natural evolution of Gradle become deprecated, and scheduled to be removed in the next major Gradle version (Gradle 4.0). See the User guide section on the “Feature Lifecycle” for more information.

The following are the newly deprecated items in this Gradle release. If you have concerns about a deprecation, please raise it via the Gradle Forums.

Plural task output registration APIs

The following APIs have been deprecated:

Potential breaking changes

Sonar plugin has been removed

The legacy Sonar plugin has been removed from the distribution. It is superceded by the official plugin from SonarQube (http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Gradle).

Ant-Based Scala Compiler has been removed

The deprecated Ant-Based Scala Compiler has been removed from Gradle 3.0. The Zinc Scala Compiler is now used exclusively. The following properties have been removed from the ScalaCompile task:

  1. daemonServer
  2. fork
  3. useAnt
  4. useCompileDaemon

Support for TestNG javadoc annotations has been removed

The support for declaring TestNG tests via javadoc annotations has been removed. The Test.testSrcDirs and the methods on TestNGOptions were removed, too, since they are not needed any more.

Task property annotations on implemented interfaces

In previous versions, annotations on task properties like @InputFile and @OutputDirectory were only taken into account when they were declared on the task class itself, or one of its super-classes. Since Gradle 3.0 annotations declared on implemented interfaces are also taken into account.

eclipse-wtp handling of external dependencies changed

For Java projects, the eclipse-wtp plugin no longer adds external dependencies to the WTP component file, but to the classpath instead. Any customizations related to external dependencies that were made in the eclipse.wtp.component.file hooks now need to be done in the eclipse.classpath.file hooks instead.

eclipse-wtp is automatically applied when the war or ear plugins are applied

User who are building war projects with Eclipse, but for any reason do not want to have WTP enabled can deactivate WTP like this:

eclipse.project { natures.removeAll { it.startsWith('org.eclipse.wst') } buildCommands.removeAll { it.name.startsWith('org.eclipse.wst') } }

Changes to previously deprecated APIs

Eclipse model contains classpath attributes for project and external dependencies

The EclipseProjectDependency and EclipseExternalDependency models now contain ClasspathAttributes. By default the JavaDoc location attribute and WTP deployment attributes are populated.

Any customizations done via eclipse.classpath.file.beforeMerged and eclipse.classpath.file.whenMerged are also reflected in these tooling models.

External contributions

We would like to thank the following community members for making contributions to this release of Gradle.

We love getting contributions from the Gradle community. For information on contributing, please see gradle.org/contribute.

Known issues

Known issues are problems that were discovered post release that are directly related to changes made in this release.