Gradle 1.0-milestone-9 Migration Guide

Skip to end of metadata
Go to start of metadata
Please see Gradle 1.0-milestone-9 Release Notes for details of the features in this release.

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:

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:

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:

(the above will produce a deprecation warning)

You now do:

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:

  • dir(String path)

ExcludeRule

The following methods of ExcludeRule are deprecated:

  • getExcludeArgs() is deprecated. Instead you should use getGroup() and getModule() to get information about the properties of the ExcludeRule.

Project

The following methods of Project are deprecated:

  • childrenDependOnMe() is deprecated with no replacement.
  • dependsOnChildren() is deprecated with no replacement.
  • dependsOnChildren(boolean evaluateDependsOnProject) is deprecated with no replacement.
  • dependsOn(String path) is deprecated. You should create dependencies on a task level instead.
  • dependsOn(String path, boolean evaluateDependsOnProject) is deprecated. You should create dependencies on a task level instead.

Examples for dynamic declaration of inter project task dependencies:

SourceTask

The following methods of SourceTask are deprecated:

  • getDefaultSource() is deprecated. Use getSource() instead.

C++ Plugin classes

The following methods are deprecated, with no replacement:

  • CompileSpec.compile()
  • Binary.getProject()
  • GppCompileSpec.getExtension() and setExtension()
  • GppCompileSpec.getTask() and setTask()
  • GppCompileSpec.sharedLibrary()
  • GppCompileSpec.setBinary()

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 targetCompatibility  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:

  • org.grade.plugins.binaries.model.Compiler.getCompileSpecFactory().

The following classes were removed:

  • org.gradle.plugins.binaries.model.CompileSpecFactory
  • org.gradle.plugins.cpp.gpp.Gpp

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:

  • -t and --tasks (replaced by the “tasks” built in task)
  • -d and --dependencies (replaced by the “dependencies” built in task)
  • -p and --prooperties (replaced by the “properties” built in task)
  • -e and --embedded (use an init script instead)

org.gradle.StartParameter

The following methods were removed:

  • getBuildScriptSource()
  • setBuildScriptSource(*)
  • getSettingsScriptSource()
  • setSettingsScriptSource(*)
  • getProjectDependenciesBuildInstruction()
  • setProjectDependenciesBuildInstruction(*)
  • getDefaultProjectSelector()
  • setDefaultProjectSelector(*)
  • useEmbeddedBuildFile()

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

org.gradle.api.DomainObjectCollection

The following methods were removed:

  • getAll()
  • findAll(Spec)
  • allObjects(Action)
  • allObject(Closure)

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:

  • getBuildDirName()
  • setBuildDirName(*)
  • usePlugin(*)
  • createTask(*)
  • absolutePath(*)
  • disableStandardOutputCapture()
  • captureStandardOutput(*)

org.gradle.api.Task

The following methods were removed:

  • disabledStandardOutputCapture()
  • captureStandardOutput(*)

org.gradle.api.Script

The following methods were removed:

  • disableStandardOutputCapture()
  • captureStandardOutput(*)

org.gradle.api.logging.LoggingManager

The following methods were removed:

  • disableStandardOutputCapture()
  • isStandardOutputCaptureEnabled()

org.gradle.api.artifacts.Configuration

The following methods were removed:

  • getBuildArtifacts(*)
  • getDependencies(Class)
  • getAllDependencies(Class)
  • addDependency(*)
  • getAllArtifactFiles(*)
  • addArtifact(*)
  • removeArtifact(*)

org.gradle.api.artifacts.dsl.RepositoryHandler

The following methods were removed:

  • getMavenPomDir()

org.gradle.api.artifacts.repositories.IvyArtifactRepository

The following properties were removed:

  • userName
  • password

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:

  • allPlugins(*)

org.gradle.api.tasks.TaskContainer

The following methods have been removed:

  • allTasks(*)

org.gradle.plugins.ide.api.GeneratorTask

The following methods have been removed:

  • beforeConfigure(*)
  • whenConfigured(*)

org.gradle.plugins.ide.api.XmlGeneratorTask

The following methods have been removed:

  • withXml(*)

org.gradle.plugins.ide.eclipse.GenerateEclipseJdt

The following properties have been removed:

  • sourceCompatibility
  • targetCompatibility

org.gradle.plugins.ide.eclipse.GenerateEclipseProject

The following properties have been removed:

  • projectName
  • comment
  • referencedProjects
  • natures
  • buildCommands
  • links

The following methods have been removed:

  • natures(*)
  • referencedProjects(*) 
  • buildCommand(*)
  • link(*)

org.gradle.plugins.ide.eclipse.GenerateEclipseWtpFacet

The following properties have been removed:

  • facets

The following methods have been removed:

  • facet(*)

org.gradle.plugins.ide.idea.GenerateIdeaModule

The following properties have been removed:

  • moduleDir
  • sourceDirs
  • testSourceDirs
  • excludeDirs
  • inheritOutputDirs
  • outputDir
  • testOutputDir
  • javaVersion
  • downloadSources
  • downloadJavadoc
  • variables
  • scopes
  • moduleName

org.gradle.plugins.ide.idea.GenerateIdeaProject

The following properties have been removed:

  • javaVersion
  • subprojects
  • wildcards

org.gradle.api.plugins.MavenPluginConvention

The following methods have been removed:

  • getPomDirName()
  • setPomDirName(*)
  • getPomDir()

org.gradle.api.tasks.SourceSet

The following methods have been removed:

  • getClassesDir()
  • setClassesDir(*)
  • getClasses()

org.gradle.api.tasks.testing.TestLogging

The following methods have been removed:

  • setShowStandardStream(*)

org.gradle.api.tasks.wrapper.Wrapper

The following properties have been removed:

  • scriptDestinationPath
  • jarPath
  • archiveName
  • archiveClassifier
  • urlRoot
  • jarPath

Tooling API

org.gradle.tooling.model.Project has been removed. The removed getProjectDirectory() method has been added to 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 org.gradle.tooling.model.HierarchicalElement.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.