Gradle Release Notes
Version 1.0-milestone-9
- New and Noteworthy
- Daemon no longer experimental
- Extra Properties
- Many deprecated API items removed
- Java compiler integration
- Copy and archive tasks preserve file permissions on UNIX
- 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.
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.
- Mac OS X support, G+\+ and XCode.
- Windows support, with Visual C+\+ and MinGW.
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:
- Avoid setting the org.gradle.java.home and org.gradle.jvmargs in a gradle.properties file for your build
- Run the build with the daemon enabled (set org.gradle.daemon=true in a gradle.properties file, or run with \--daemon)
Fixed Jira Issues
1.0-milestone-9 Migration Guide
- Known Issues
- GRADLE-971 - fileMode not working for the copy task
- GRADLE-2185 - NPE launching Tooling API from Eclipse on Windows
- GRADLE-2197 - Full debugging information not included in compiled classes
- Deprecations
- Dynamic Properties
- Passing custom objects to Project.file() and Project.files()
- Passing custom objects to Task.dependsOn()
- Passing not existing archives to Project.tarTree() or Project.zipTree()
- Directory Task
- API classes and methods
- AbstractProject
- ExcludeRule
- Project
- SourceTask
- C+\+ Plugin classes
- Potential Breaking Changes
- Updated to Groovy 1.8.6
- Changed default value of sourceCompatibility in Java Plugin
- Default file names for C+\+ executables and binaries
- Restrictive evaluation of ExcludeRule definitions
- Timestamp handling of Copy Actions
- Some C+\+ plugin classes changed
- Gradle forks a new JVM to run non-daemon build with org.gradle.java.home or org.gradle.jvmargs specified
- Deprecated Item Removals
- Command Line Interface
- org.gradle.StartParameter
- org.gradle.api.DomainObjectCollection
- org.gradle.api.LocationAwareException
- org.gradle.api.ScriptCompilationException
- org.gradle.api.Project
- org.gradle.api.Task
- org.gradle.api.Script
- org.gradle.api.logging.LoggingManager
- org.gradle.api.artifacts.Configuration
- org.gradle.api.artifacts.dsl.RepositoryHandler
- org.gradle.api.artifacts.repositories.IvyArtifactRepository
- org.gradle.api.artifacts.specs.Type
- org.gradle.api.artifacts.specs.DependencySpecs
- org.gradle.api.tasks.ConventionValue
- org.gradle.api.plugins.PluginContainer
- org.gradle.api.tasks.TaskContainer
- org.gradle.plugins.ide.api.GeneratorTask
- org.gradle.plugins.ide.api.XmlGeneratorTask
- org.gradle.plugins.ide.eclipse.GenerateEclipseJdt
- org.gradle.plugins.ide.eclipse.GenerateEclipseProject
- org.gradle.plugins.ide.eclipse.GenerateEclipseWtpFacet
- org.gradle.plugins.ide.idea.GenerateIdeaModule
- org.gradle.plugins.ide.idea.GenerateIdeaProject
- org.gradle.api.plugins.MavenPluginConvention
- org.gradle.api.tasks.SourceSet
- org.gradle.api.tasks.testing.TestLogging
- org.gradle.api.tasks.wrapper.Wrapper
- 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)
}
}
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.
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:
- 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:
//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:
- 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:
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:
- beforeConfigure\(*)
- whenConfigured\(*)
org.gradle.plugins.ide.api.XmlGeneratorTask
The following methods have been removed:
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:
The following methods have been removed:
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
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.