// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

[[feature_lifecycle]]
= The Feature Lifecycle

Gradle is under constant development and improvement. New versions are delivered on a regular and frequent basis (approximately every 6 weeks) as described in <<#eol_support,the section on end-of-life support>>. Continuous improvement combined with frequent delivery allows new features to be made available to users early and for invaluable real world feedback to be incorporated into the development process. Getting new functionality into the hands of users regularly is a core value of the Gradle platform. At the same time, API and feature stability is taken very seriously and is also considered a core value of the Gradle platform. This is something that is engineered into the development process by design choices and automated testing, and is formalised by <<#backwards_compatibility,the section on backwards compatibility>>.

The Gradle _feature lifecycle_ has been designed to meet these goals. It also serves to clearly communicate to users of Gradle what the state of a feature is. The term _feature_ typically means an API or DSL method or property in this context, but it is not restricted to this definition. Command line arguments and modes of execution (e.g. the Build Daemon) are two examples of other kinds of features.


[[sec:states]]
== States

Features can be in one of 4 states:

* Internal
* Incubating
* Public
* Deprecated


[[sec:internal]]
=== Internal

Internal features are not designed for public use and are only intended to be used by Gradle itself. They can change in any way at any point in time without any notice. Therefore, we recommend avoiding the use of such features. Internal features are not documented. If it appears in this User Manual, the DSL Reference or the API Reference documentation then the feature is not internal.

Internal features may evolve into public features.

[[sec:incubating_state]]
=== Incubating

Features are introduced in the _incubating_ state to allow real world feedback to be incorporated into the feature before it is made public and locked down to provide backwards compatibility. It also gives users who are willing to accept potential future changes early access to the feature so they can put it into use immediately.

A feature in an incubating state may change in future Gradle versions until it is no longer incubating. Changes to incubating features for a Gradle release will be highlighted in the release notes for that release. The incubation period for new features varies depending on the scope, complexity and nature of the feature.

Features in incubation are clearly indicated to be so. In the source code, all methods/properties/classes that are incubating are annotated with link:{javadocPath}/org/gradle/api/Incubating.html[Incubating], which is also used to specially mark them in the DSL and API references. If an incubating feature is discussed in this User Manual, it will be explicitly said to be in the incubating state.

[[feature_preview]]
==== Feature Preview API

The feature preview API allows certain incubating features to be activated by adding `enableFeaturePreview('FEATURE')` in your _settings_ file. Individual preview features will be announced in release notes.

When _incubating_ features are either promoted to _public_ or removed, the feature preview flags for them become obsolete, have no effect and should be removed from the settings file.

[[sec:public]]
=== Public

The default state for a non-internal feature is _public_. Anything that is documented in the User Manual, DSL Reference or API references that is not explicitly said to be incubating or deprecated is considered public. Features are said to be _promoted_ from an incubating state to public. The release notes for each release indicate which previously incubating features are being promoted by the release.

A public feature will _never_ be removed or intentionally changed without undergoing deprecation. All public features are subject to the backwards compatibility policy.

[[sec:deprecated]]
=== Deprecated

Some features will become superseded or irrelevant due to the natural evolution of Gradle. Such features will eventually be removed from Gradle after being _deprecated_. A deprecated feature will _never_ be changed, until it is finally removed according to the backwards compatibility policy.

Deprecated features are clearly indicated to be so. In the source code, all methods/properties/classes that are deprecated are annotated with “`@java.lang.Deprecated`” which is reflected in the DSL and API references. In most cases, there is a replacement for the deprecated element, and this will be described in the documentation. Using a deprecated feature will also result in a runtime warning in Gradle's output.

Use of deprecated features should be avoided. The release notes for each release indicate any features that are being deprecated by the release.

[[backwards_compatibility]]
== Backwards Compatibility Policy

Gradle provides backwards compatibility across major versions (e.g. `1.x`, `2.x`, etc.). Once a public feature is introduced or promoted in a Gradle release it will remain indefinitely or until it is deprecated. Once deprecated, it may be removed in the next major release. Deprecated features may be supported across major releases, but this is not guaranteed.

[[eol_support]]
== Release end-of-life Policy

Every day, a new nightly build of Gradle is created.  This contains all of the changes that have made it through Gradle's extensive continuous integration tests during that day.  Not every nightly may contain new changes and not every nightly may be stable.

For each minor or major release, the Gradle team creates a pre-release distribution called a release candidate (RC). When no problems are found after a short period of time (usually a week), the release candidate is promoted to a final/general availability (GA) release. If a regression is found in the release candidate, a new RC distribution is created and the process repeats.  Release candidates are supported for as long as the release window is open, but they are not intended to be used long term for production use. Bug reports are greatly appreciated during the RC phase.

After a final release, the Gradle team may create additional patch releases that are intended to replace the previous final release due to an important bugfix or regression.  For instance, Gradle 5.2.1 replaces the Gradle 5.2 release.  Once a release candidate has been made, all feature development moves on to the next release.  As such, each Gradle release causes the previous release to become end-of-line (EOL) and that release will not receive any new bugfixes or feature backports.
