Gradle 2.0 is the next major Gradle release that offers the opportunity to make breaking changes to the public interface of Gradle. This document captures a laundry list of ideas to consider before shipping Gradle 2.0.
Note: for the change listed below, the old behaviour or feature to be removed should be deprecated in a Gradle 1.x release, probably no later than Gradle 1.8. Similarly for changes to behaviour.
The following stories are to be included in Gradle 2.0.
In the Gradle 2.0-rc-1 release, remove all features that are deprecated as at Gradle 1.8 or earlier:
- Search for usages of
DeprecationLogger
,@Deprecated
,@deprecated
and remove the associated feature. - Review usages of
DeprecationLogger.whileDisabled()
.
These types expose the implementation details of dependency management and force a certain implementation on Gradle. Removing these types from the API allows us to implement new features and remove some internal complexity.
- Remove methods from
ArtifactRepositoryContainer
andRepositoryHandler
that accept an IvyDependencyResolver
as parameter. - Remove methods from
ArtifactRepositoryContainer
that returnDependencyResolver
. - Remove
RepositoryHandler.mavenRepo()
. - Change the
MavenResolver
implementation so that it no longer extendsDependencyResolver
. - Change the
FlatDirRepository
implementation so that it no longer uses aDependencyResolver
implementation. - Remove Ivy version from the output of
gradle -v
.
Now that we have reasonable tooling support via the tooling API, remove the Open API.
- Implement a stub to fail with a reasonable error message when attempting to use Gradle from the Open API.
- Remove the remaining Open API classes and project.
- Add integration test coverage.
The public API for launching Gradle is now the tooling API. The GradleBuild
task can also be used.
- Replace internal usages of the static
GradleLauncher
methods. - Remove the
GradleLauncher
type from the public API. - Remove the public
StartParameter
constructor. - Change
StartParameter
into an interface.
- Remove unused
IllegalOperationAtExecutionTimeException
. - Remove unused
AntJavadoc
.
The following stories are candidates to be included in Gradle 2.0. They have not been scheduled yet:
Alternatively, default the group to null
.
- Change the default for
useAnt
tofalse
and deprecate theuseAnt
property.
- Change the old publishing DSL to use the Maven 3 classes instead of Maven 2 classes. This affects:
MavenResolver.settings
MavenDeployer.repository
andsnapshotRepository
.MavenPom.dependencies
.
- Remove
MavenDeployer.addProtocolProviderJars()
. - Change
PublishFilter
so that it accepts aPublishArtifact
instead of anArtifact
.
There are serveral inconsitencies and confusing behaviours in the copy tasks and copy spec:
- Change copy tasks so that they no longer implement
CopySpec
. Instead, they should have acontent
property which is aCopySpec
that contains the main content. Leave behind some methods which operate on the file tree as a whole, egeachFile()
,duplicatesStrategy
,matching()
. - Change the copy tasks so that
into
always refers to the root of the destination file tree, and thatdestinationDir
(possibly with a better name) is instead used to specify the root of the destination file tree, for those tasks that produce a file tree on the file system. - Change the
Jar
type so that there is a singlemetaInf
copy spec which is a child of the main content, rather than creating a new copy spec each timemetainf
is referenced. Do the same forWar.webInf
. - The
CopySpec.with()
method currently assumes that a root copy spec is supplied with all values specified, and no values are inherted by the attached copy spec. Instead, changeCopySpec.with()
so that values are inherited from the copy spec. - Change the default duplicatesStrategy to
fail
or perhapswarn
. - Change the
Ear
type so that the generated descriptor takes precedence over a descriptor in the main content, similar to the manifest forJar
and the web XML forWar
.
- Move defaults for output directory to the tasks and remove from base plugin.
- Use
${task.name}.${task.extension}
as the default archive name, so that the default does not conflict with the default for another archive task.
The current defaults for the outputs of tasks of type Test
conflict with each other:
- Change the default result and report directory for the
Test
type to include the task's name, so that the default does not conflict with the default for anotherTest
task.
The old dependency result graph is expensive in terms of heap usage. We should remove it.
- Promote new dependency result graph to un-incubate it.
- Remove methods that use
ResolvedDependency
andUnresolvedDependency
. - Keep
ResolvedArtifact
and replace it later, as it is not terribly expensive to keep.
Some model types hand-code the DSL conventions in their API. We should remove these and let the DSL decoration take care of this, to simplify these types and to offer a more consistent DSL.
- Remove all methods that accept a
Closure
when anAction
overload is available. Add missing overloads where appropriate. - Remove all methods that accept a
String
orObject
when a enum overload is available. Add missing overloads where appropriate. - Remove CharSequence -> Enum conversion code in
DefaultTaskLogging
. - Remove all set methods that contain no custom logic.
- Remove support from the consumer for providers earlier than 1.0-milestone-8:
- Consumer fails with a decent error message instead of falling back to the methods on
ConnectionVersion4
. - Add integration test coverage.
- Consumer fails with a decent error message instead of falling back to the methods on
- Remove support from the provider for consumers earlier than 1.2 (we can't tell the difference between clients from 1.0-milestone-8 and 1.1).
- Change the implementation of methods on
ConnectionVersion4
andInternalConnection
to fail with a decent error message. - Model implementations no longer need to implement
ProjectVersion3
or the protocol interfaces. - Add integration test coverage.
- Change the implementation of methods on
- Move
UnsupportedBuildArgumentException
andUnsupportedOperationConfigurationException
up toorg.gradle.tooling
, to remove package cycle from the API.
- Inline
ConventionTask
andAbstractTask
intoDefaultTask
. - Remove
Task.dependsOnTaskDidWork()
. - Mix
TaskInternal
in during decoration and remove references to internal types.
- Remove
Configurable
from public API types. - Remove
PomFilterContainer.getActivePomFilters()
. - Change
StartParameter
so that it no longer extendsLoggingConfiguration
. - Move
ConflictResolution
from public API (it's only used internally). - Move
Module
from public API (it's only used internally). - Move
Logging.ANT_IVY_2_SLF4J_LEVEL_MAPPER
from public API. - Move
AntGroovydoc
andAntScalaDoc
from public API. - Move
BuildExceptionReporter
,BuildResultLogger
,TaskExecutionLogger
andBuildLogger
from public API.
Extension objects have been available for over 2 years and are now an established pattern.
- Migrate core plugins to use extensions.
- Remove
Convention
type.
- Remove the specialised subclasses of
UnknownDomainObjectException
and the overridden methods that exist simply to declare this fromPluginContainer
,ArtifactRepositoryContainer
,ConfigurationContainer
,TaskCollection
. - Remove the specialised methods such as
whenTaskAdded()
fromPluginCollection
,TaskCollection
- Remove the
extends T
upper bound on the type variable ofDomainObjectCollection.withType()
. - Remove the type varable from
ReportContainer
- Remove unused constants from
ArtifactRepositoryContainer
- Move
ReportContainer.ImmutableViolationException
to make top level.
- Remove
equals()
implementations fromDependency
subclasses. - Remove
ExternalDependency.force
. Use resolution strategy instead. - Remove
SelfResolvingDependency.resolve()
methods. These should be internal and invoked only as part of resolution. - Remove
ClientModule
and replace with consumer-side component meta-data rules. - Remove
ExternalModuleDependency.changing
. Use component meta-data rules instead.
- Rename
IllegalDependencyNotation
to addException
to the end of its name. - Remove
ConventionProperty
, replace it with documentation. - Remove
Settings.startParameter
. Can usegradle.startParameter
instead. - Remove
org.gradle.util
from default imports. - Remove
AbstractOptions
.
Promote the sonar-runner
plugin and remove the sonar
plugin.
Would still be able to compile for Java 5. Would need to improve cross-compilation support.
Replace all usages of JNA and JNA-Posix with native-platform. Currently, this means that console support and UNIX file permissions with JVMs earlier than Java 7 will not be supported on the following platforms:
- Linux-ia64
- Solaris-x86, -amd64, -sparc, -sparcv9
- FreeBSD-i386, -amd64
Decorating classes at load time is generally a more reliable approach and offers a few new interesting use cases we can support. For example, by decorating classes
at load time we can support expressions such as new MyDslType()
, rather than requiring that Gradle control the instantiation of decorated objects.
Switching to decoration at load time should generally be transparent to most things, except for clients of ProjectBuilder
that refer to types
which are not loaded by Gradle, such as the classes under test.
- Rename buildDependents to buildDownstream
- Rename buildNeeded to buildUpstream
- Add a new task buildStream which is equivalent to buildDownstream buildUpstream
- A Gradle best pattern is to name the gradle file to be the same name as the subproject.
- In Gradle 2.0, let's support this out of the box, possibly as a preference to
build.gradle
, and maybe drop support forbuild.gradle
in subprojects.
Change from:
repositories {
mavenCentral()
}
to:
repositories {
central()
}