Package org.gradle.util
Class GradleVersion
java.lang.Object
org.gradle.util.GradleVersion
- All Implemented Interfaces:
Comparable<GradleVersion>
Represents a Gradle version.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract int
static GradleVersion
current()
Returns the current Gradle version.abstract GradleVersion
The base version of this version.abstract String
Deprecated.will be removed in Gradle 9.abstract GradleVersion
Deprecated.will be removed in Gradle 9.abstract String
Deprecated.will be removed in Gradle 9.abstract String
Returns the string that represents this version.abstract boolean
Returnstrue
if this instance represent a snapshot version (e.g.abstract boolean
isValid()
Deprecated.will be removed in Gradle 9.static GradleVersion
Parses the given string into a GradleVersion.
-
Field Details
-
URL
Deprecated.will be removed in Gradle 9.This field only kept here to maintain binary compatibility.- See Also:
-
RESOURCE_NAME
Deprecated.will be removed in Gradle 9.This field only kept here to maintain binary compatibility.- See Also:
-
VERSION_OVERRIDE_VAR
Deprecated.will be removed in Gradle 9.This field only kept here to maintain binary compatibility.- See Also:
-
VERSION_NUMBER_PROPERTY
Deprecated.will be removed in Gradle 9.This field only kept here to maintain binary compatibility.- See Also:
-
-
Constructor Details
-
GradleVersion
public GradleVersion()
-
-
Method Details
-
current
Returns the current Gradle version.- Returns:
- The current Gradle version.
-
version
Parses the given string into a GradleVersion.- Throws:
IllegalArgumentException
- On unrecognized version string.
-
getVersion
Returns the string that represents this version.- Returns:
- this Gradle version in string format.
-
getBuildTime
Deprecated.will be removed in Gradle 9.This method only kept here to maintain binary compatibility. -
getRevision
Deprecated.will be removed in Gradle 9.This method only kept here to maintain binary compatibility. -
isSnapshot
public abstract boolean isSnapshot()Returnstrue
if this instance represent a snapshot version (e.g. 7.0-20210406233629+0000).- Returns:
- Whether the current instance is a snapshot version
-
getBaseVersion
The base version of this version. For pre-release versions, this is the target version. For example, the version base of '7.0-rc-1' is '7.0'.- Returns:
- The version base
-
getNextMajor
Deprecated.will be removed in Gradle 9.This method only kept here to maintain binary compatibility. -
isValid
Deprecated.will be removed in Gradle 9.This method only kept here to maintain binary compatibility. -
compareTo
- Specified by:
compareTo
in interfaceComparable<GradleVersion>
-