Gradle Release Notes

Version 1.0-milestone-9

  1. New and Noteworthy
    1. Daemon no longer experimental
    2. Extra Properties
    3. Many deprecated API items removed
    4. Java compiler integration
    5. Copy and archive tasks preserve file permissions on UNIX
    6. Improvements to DSL

New and Noteworthy

Daemon no longer experimental

The Gradle Daemon is no longer considered experimental and is considered stable. See the user guide chapter on the Gradle Daemon for more information.

Extra Properties

The new "Extra Properties" mechanism replaces "Dynamic Properties". See the relevant section of the migration guide for more information.

Many deprecated API items removed

We've shed some weight as we prepare for 1.0 final by removing some long deprecated items. The full list is in the migration guide.

Java compiler integration

The (Java) Compile task now uses Gradle's own compiler integration by default, rather than using the Ant javac task. In many cases, this already speeds up compilation today, and it will allow us to do further improvements in the future. When run in fork mode (compile.options.fork = true), Gradle's compiler configuration won't fork a new JVM for each compile task, but will try to reuse the same JVM as much as possible. This can result in a significant speedup (in particular for builds with many smaller projects) while still giving you all the advantages of forking (like advanced compiler configuration options). For the time being, you can still get back the Ant javac integration with compile.options.useAnt = true.

Copy and archive tasks preserve file permissions on UNIX

Improvements to DSL

You can now pass Task outputs to the from method of copy or archive tasks. This adds an implicit dependency to the output producing task.


task aCopyTask(type:Copy){
    from anotherTask.outputs
    into 'somedir'
}

As a default, the evaluation of child projects depends on the evaluation of its parent projects. Changing this default behavior has been simplified:

1.0-milestone-8 1.0-milestone-9


childProjects.each{childProjName, childProj ->
  project.evaluationDepends(childProjName)
}    

evaluationDependsOnChildren()    

Improved C+\+ support

It is now easier to work with executables that use shared libraries. The C+\+ plugins now add an installMain task, which creates a local development installation of the executable, that also includes the shared libraries that the executable requires at runtime. You can run the executable directly out of the installation, without needing to install shared libraries or to mess with platform-specific environment variables.

Non-daemon builds honour build environment properties

In previous versions, only builds executed with the Gradle daemon would honour the org.gradle.java.home and org.gradle.jvmargs properties. These properties are now honoured by non-daemon builds as well. In order to do this, Gradle needs to fork a new JVM if the launched build process does not satisfy these requirements. In order to avoid the performance impact of Gradle launching a second JVM for every build execution, you can:

Fixed Jira Issues

Jirra Issues
Type Key Summary Assignee Reporter Priority Status Resolved Created Uploaded Due
GRADLE-2158 Zip files created on Windows platform have zero FilePermission when unpacked with Gradle René Gröschke René Gröschke Resolved Fixed 07/Mar/12 04/Jan/13
GRADLE-2127 C++ plugin should provide support for mingw Unassigned Adam Murdoch Resolved Fixed 27/Feb/12 04/Jan/13
GRADLE-2126 Extraneous output prefix is seen on every line when output from gradlew on Unix is redirected to file Unassigned Gradle Forums Resolved Fixed 26/Feb/12 04/Jan/13
GRADLE-2120 ConfigureUtil.configureByMap does not work correctly with decorated objects (does not call methods with the given name) Luke Daley Luke Daley Resolved Fixed 22/Feb/12 04/Jan/13
GRADLE-2119 Cannot specify builtBy for artifact using map notation Luke Daley Luke Daley Resolved Fixed 22/Feb/12 04/Jan/13
GRADLE-2117 provide support for visual c++ Unassigned Adam Murdoch Resolved Fixed 22/Feb/12 04/Jan/13
GRADLE-2116 provide c++ support on mac os x Unassigned Adam Murdoch Resolved Fixed 22/Feb/12 04/Jan/13
GRADLE-2108 cpp executable that links against shared libraries does not work if the shared libraries are moved from their link-time location Unassigned Adam Murdoch Resolved Fixed 15/Feb/12 04/Jan/13
GRADLE-2104 milestone-8 : jsch-0.1.42.jar missing, Ivy SFTPResolver can not be be used anymore Unassigned Gradle Forums Resolved Fixed 15/Feb/12 04/Jan/13
GRADLE-2102 Tooling API LongRunningOperation.setJavaHome() fails with NoClassDefFoundError Szczepan Faber Adam Murdoch Resolved Fixed 15/Feb/12 04/Jan/13
GRADLE-2099 Impossible to set the default character encoding when using the daemon Luke Daley Luke Daley Resolved Fixed 14/Feb/12 04/Jan/13
GRADLE-2081 warning emitted when compiling using openjdk 7 René Gröschke Adam Murdoch Resolved Fixed 04/Feb/12 04/Jan/13
GRADLE-2079 Eclipse plugin generates invalid javadoc locations Unassigned Alex Romanyuk Resolved Fixed 03/Feb/12 04/Jan/13
GRADLE-2076 Artifact not found resolving dependencies with packaging/type "eclipse-plugin" Daz DeBoer Gradle Forums Resolved Fixed 01/Feb/12 04/Jan/13
GRADLE-2072 CopySpec.from .outputs is silently ignored Unassigned Adam Murdoch Resolved Fixed 29/Jan/12 04/Jan/13
GRADLE-2068 archives built from configurations contain duplicate jars (M5->M6 regression) Daz DeBoer Szczepan Faber Resolved Fixed 25/Jan/12 04/Jan/13
GRADLE-2044 Cannot manually remove dependencies from milestone-8 cache structure Daz DeBoer Chris Beams Resolved Fixed 12/Jan/12 04/Jan/13
GRADLE-2038 Tar decompression should also understand .bz2 and .gz extensions René Gröschke Ben Jansen Resolved Fixed 09/Jan/12 04/Jan/13
GRADLE-2036 Excludes DSL needs some improvements (error on unknown keys, error if no valid keys) Unassigned Gradle Forums Resolved Fixed 06/Jan/12 04/Jan/13
GRADLE-2019 EAR plugin fails if JavaBasePlugin is applied before the EAR plugin (and JavaPlugin is not applied) René Gröschke Andrew Oberstar Resolved Fixed 30/Dec/11 04/Jan/13
GRADLE-1900 Apply the repo location from the maven config in mavenLocal() Peter Niederwieser Mike M. Resolved Fixed 08/Nov/11 04/Jan/13
GRADLE-1872 Regular use of eclipse tooling api leads to deprecation warnings Luke Daley Szczepan Faber Resolved Fixed 27/Oct/11 04/Jan/13
GRADLE-1857 source(someDir) is not adding the directory to the set of sources, instead is clobbering it Unassigned David Kowis Resolved Fixed 20/Oct/11 04/Jan/13
GRADLE-1771 Tooling API should start daemon with -client option (or at least provide a way to control options passed to daemon process) Szczepan Faber Kris De Volder Resolved Fixed 29/Aug/11 04/Jan/13
GRADLE-1680 Eclipse plugin generates incorrect path for library javadocs Unassigned Adam Murdoch Resolved Fixed 20/Jul/11 04/Jan/13
GRADLE-1618 file.encoding System property (and GRADLE_OPTS) not passed to Daemon Luke Daley David Fogel Resolved Fixed 15/Jun/11 04/Jan/13
GRADLE-1531 Compile seems to ignore options.encoding Unassigned Peter Rietzler Resolved Fixed 12/May/11 04/Jan/13
GRADLE-1483 Tasks of type JavaExec fails to honor inputs/outputs Luke Daley Magnus Rundberget Resolved Fixed 18/Apr/11 04/Jan/13
GRADLE-1381 The 'eclipse' task for Gradle's build is incredibly slow Unassigned Peter Niederwieser Resolved Fixed 07/Feb/11 04/Jan/13
GRADLE-1255 Exclude rule silently excludes everything if neither 'module' or 'group' specified Unassigned Adam Murdoch Resolved Fixed 15/Dec/10 04/Jan/13
GRADLE-1246 Fails silently when try to unzip non-existent file Unassigned Peter Bell Resolved Fixed 06/Dec/10 04/Jan/13
GRADLE-796 Copy task should preserve file permissions Peter Niederwieser Adam Murdoch Resolved Fixed 12/Jan/10 04/Jan/13
GRADLE-673 file permissions not preserved in Tar task Peter Niederwieser Philip Crotwell Resolved Fixed 02/Oct/09 04/Jan/13

1.0-milestone-9 Migration Guide

Please see Gradle 1.0-milestone-9 Release Notes for details of the features in this release.

  1. Known Issues
    1. GRADLE-971 - fileMode not working for the copy task
    2. GRADLE-2185 - NPE launching Tooling API from Eclipse on Windows
    3. GRADLE-2197 - Full debugging information not included in compiled classes
  2. Deprecations
    1. Dynamic Properties
    2. Passing custom objects to Project.file() and Project.files()
    3. Passing custom objects to Task.dependsOn()
    4. Passing not existing archives to Project.tarTree() or Project.zipTree()
    5. Directory Task
    6. API classes and methods
      1. AbstractProject
      2. ExcludeRule
      3. Project
      4. SourceTask
      5. C+\+ Plugin classes
  3. Potential Breaking Changes
    1. Updated to Groovy 1.8.6
    2. Changed default value of sourceCompatibility in Java Plugin
    3. Default file names for C+\+ executables and binaries
    4. Restrictive evaluation of ExcludeRule definitions
    5. Timestamp handling of Copy Actions
    6. Some C+\+ plugin classes changed
    7. Gradle forks a new JVM to run non-daemon build with org.gradle.java.home or org.gradle.jvmargs specified
    8. Deprecated Item Removals
      1. Command Line Interface
      2. org.gradle.StartParameter
      3. org.gradle.api.DomainObjectCollection
      4. org.gradle.api.LocationAwareException
      5. org.gradle.api.ScriptCompilationException
      6. org.gradle.api.Project
      7. org.gradle.api.Task
      8. org.gradle.api.Script
      9. org.gradle.api.logging.LoggingManager
      10. org.gradle.api.artifacts.Configuration
      11. org.gradle.api.artifacts.dsl.RepositoryHandler
      12. org.gradle.api.artifacts.repositories.IvyArtifactRepository
      13. org.gradle.api.artifacts.specs.Type
      14. org.gradle.api.artifacts.specs.DependencySpecs
      15. org.gradle.api.tasks.ConventionValue
      16. org.gradle.api.plugins.PluginContainer
      17. org.gradle.api.tasks.TaskContainer
      18. org.gradle.plugins.ide.api.GeneratorTask
      19. org.gradle.plugins.ide.api.XmlGeneratorTask
      20. org.gradle.plugins.ide.eclipse.GenerateEclipseJdt
      21. org.gradle.plugins.ide.eclipse.GenerateEclipseProject
      22. org.gradle.plugins.ide.eclipse.GenerateEclipseWtpFacet
      23. org.gradle.plugins.ide.idea.GenerateIdeaModule
      24. org.gradle.plugins.ide.idea.GenerateIdeaProject
      25. org.gradle.api.plugins.MavenPluginConvention
      26. org.gradle.api.tasks.SourceSet
      27. org.gradle.api.tasks.testing.TestLogging
      28. org.gradle.api.tasks.wrapper.Wrapper
      29. Tooling API

Known Issues

GRADLE-971 - fileMode not working for the copy task

Though this issue was marked as fixed, this issue is still open.
As a workaround, you can use File.setExecutable(true, true) to change the permissions of a file:


task copy(type:Copy){
...
...
    doLast {
        File f = file('...')
        f.setExecutable(true, true) 
    }
}

GRADLE-2185 - NPE launching Tooling API from Eclipse on Windows

The STS plugin for Gradle is unable to launch the Tooling API daemon for Gradle-1.0-milestone-9. This means that any actions trying to import or execute a Gradle build from Eclipse will fail when the build uses Gradle-1.0-milestone-9.

GRADLE-2197 - Full debugging information not included in compiled classes

By default, Gradle 1.0-milestone-9 does not include debug information about local variables. As a workaround, you can use:


compileJava.options.debugOptions.debugLevel = 'source,lines,vars"

Deprecations

Dynamic Properties

Adding new properties to domain objects by assignment (aka "Dynamic Properties") has been replaced by the new "Extra Properties" mechanism.

Instead of this:


project.myCustomProperty = "value"

(the above will produce a deprecation warning)

You now do:


project.ext.myCustomProperty = "value"

See the ExtraPropertiesExtension documentation for more information. Also see this forum post for the rationale behind this change and a chance to comment.

Passing custom objects to Project.file() and Project.files()

Passing parameters to Project.file() or Project.files() of a unrecognized type is now deprecated. In the past, any object instance could be passed and Gradle converted this object to a File reference using new File(<anyobject>.toString()).

Passing custom objects to Task.dependsOn()

Passing objects to Task.dependsOn() of other type than the explicit supported and documented is now deprecated. In the past, any object instance could be passed and Gradle mapped this object to a task dependency using toString()).

Passing not existing archives to Project.tarTree() or Project.zipTree()

Referencing not existing archives to Project.tarTree() or Project.zipTree() was silently ignored in the past. This has been deprecated and will be handled stricter in the next version of Gradle.

Directory Task

The Directory task has been deprecated. You should use Project.mkdir(Object) instead.

API classes and methods

AbstractProject

The following methods of AbstractProject are deprecated, with no replacement:

ExcludeRule

The following methods of ExcludeRule are deprecated:

Project

The following methods of Project are deprecated:

Examples for dynamic declaration of inter project task dependencies:


//clean task in root project depends on the clean task of all sub projects.
clean.dependsOn subprojects.collect { "$it.path:clean" }


//test task of root project depends on test tasks in groovy subprojects.
task test(dependsOn: groovyProjects()*.test)

def groovyProjects() {
    subprojects.findAll { !(it.name in ["docs", "website"]) }
}

SourceTask

The following methods of SourceTask are deprecated:

C+\+ Plugin classes

The following methods are deprecated, with no replacement:

Potential Breaking Changes

Updated to Groovy 1.8.6

Changed default value of sourceCompatibility in Java Plugin

The default sourceCompatibility in the java plugin has changed from 1.5 to the version of the current used JVM. Since the default&nbsp;targetCompatibility&nbsp; is set to sourceCompatibility this breaking change affects targetCompatibility too.

Default file names for C+\+ executables and binaries

The C+\+ plugins now use the standard naming scheme of the current operating system. For example, on Linux, the output file of the main library is libmain.so, whereas it is main.dll on Windows

The C+\+ plugins also use the project name as the base name for the main binary, rather than main.

Restrictive evaluation of ExcludeRule definitions

An InvalidUserDataException is thrown, if neither group nor module is defined for a exclude rule. Map entries other than group or module are not allowed anymore.

Timestamp handling of Copy Actions

When a copy action takes place, the lastmodified file attribute is no longer set to the same value of the source file.

Some C+\+ plugin classes changed

The following methods were removed:

The following classes were removed:

Gradle forks a new JVM to run non-daemon build with org.gradle.java.home or org.gradle.jvmargs specified

To honour these properties in a non-daemon build, Gradle must fork a new JVM to execute the build. To avoid forking a new JVM, avoid setting org.gradle.java.home or org.gradle.jvmargs for your build. If you are only concerned about the performance impact, then consider enabling the Gradle daemon.

Deprecated Item Removals

The following items, that have been deprecated for some time, have been removed:

\--note: A signature of "*" means all variants.

Command Line Interface

The following command line arguments have been removed:

org.gradle.StartParameter

The following methods were removed:

The method&nbsp;useEmptySettingsScript() has been deprecated, replaced by&nbsp;useEmptySettings().

org.gradle.api.DomainObjectCollection

The following methods were removed:

org.gradle.api.LocationAwareException

This class has been removed.

org.gradle.api.ScriptCompilationException

This class has been removed.

org.gradle.api.Project

The following methods were removed:

org.gradle.api.Task

The following methods were removed:

org.gradle.api.Script

The following methods were removed:

org.gradle.api.logging.LoggingManager

The following methods were removed:

org.gradle.api.artifacts.Configuration

The following methods were removed:

org.gradle.api.artifacts.dsl.RepositoryHandler

The following methods were removed:

org.gradle.api.artifacts.repositories.IvyArtifactRepository

The following properties were removed:

org.gradle.api.artifacts.specs.Type

This class has been removed.

org.gradle.api.artifacts.specs.DependencySpecs

This class has been removed.

org.gradle.api.tasks.ConventionValue

This class has been removed.

org.gradle.api.plugins.PluginContainer

The following methods have been removed:

org.gradle.api.tasks.TaskContainer

The following methods have been removed:

org.gradle.plugins.ide.api.GeneratorTask

The following methods have been removed:

org.gradle.plugins.ide.api.XmlGeneratorTask

The following methods have been removed:

org.gradle.plugins.ide.eclipse.GenerateEclipseJdt

The following properties have been removed:

org.gradle.plugins.ide.eclipse.GenerateEclipseProject

The following properties have been removed:

The following methods have been removed:

org.gradle.plugins.ide.eclipse.GenerateEclipseWtpFacet

The following properties have been removed:

The following methods have been removed:

org.gradle.plugins.ide.idea.GenerateIdeaModule

The following properties have been removed:

org.gradle.plugins.ide.idea.GenerateIdeaProject

The following properties have been removed:

org.gradle.api.plugins.MavenPluginConvention

The following methods have been removed:

org.gradle.api.tasks.SourceSet

The following methods have been removed:

org.gradle.api.tasks.testing.TestLogging

The following methods have been removed:

org.gradle.api.tasks.wrapper.Wrapper

The following properties have been removed:

Tooling API

org.gradle.tooling.model.Project has been removed. The removed getProjectDirectory() method has been added to&nbsp;org.gradle.tooling.model.eclipse.EclipseProject class. The removed getPath() method is available via the getGradleProject() method.

org.gradle.tooling.model.BuildableProject has been removed. The removed getTasks() method is available via the getGradleProject() method.

org.gradle.tooling.model.HierarchicalProject has been removed. It was superseded by&nbsp;org.gradle.tooling.model.HierarchicalElement.