Package org.gradle.util
Class GradleVersion
- java.lang.Object
-
- org.gradle.util.GradleVersion
-
- All Implemented Interfaces:
java.lang.Comparable<GradleVersion>
public abstract class GradleVersion extends java.lang.Object implements java.lang.Comparable<GradleVersion>
Represents a Gradle version.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringRESOURCE_NAMEDeprecated.will be removed in Gradle 9.static java.lang.StringURLDeprecated.will be removed in Gradle 9.static java.lang.StringVERSION_NUMBER_PROPERTYDeprecated.will be removed in Gradle 9.static java.lang.StringVERSION_OVERRIDE_VARDeprecated.will be removed in Gradle 9.
-
Constructor Summary
Constructors Constructor Description GradleVersion()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract intcompareTo(GradleVersion o)static GradleVersioncurrent()Returns the current Gradle version.abstract GradleVersiongetBaseVersion()The base version of this version.abstract java.lang.StringgetBuildTime()Deprecated.will be removed in Gradle 9.abstract GradleVersiongetNextMajor()Deprecated.will be removed in Gradle 9.abstract java.lang.StringgetRevision()Deprecated.will be removed in Gradle 9.abstract java.lang.StringgetVersion()Returns the string that represents this version.abstract booleanisSnapshot()Returnstrueif this instance represent a snapshot version (e.g.abstract booleanisValid()Deprecated.will be removed in Gradle 9.static GradleVersionversion(java.lang.String version)Parses the given string into a GradleVersion.
-
-
-
Field Detail
-
URL
@Deprecated public static final java.lang.String URL
Deprecated.will be removed in Gradle 9.This field only kept here to maintain binary compatibility.- See Also:
- Constant Field Values
-
RESOURCE_NAME
@Deprecated public static final java.lang.String RESOURCE_NAME
Deprecated.will be removed in Gradle 9.This field only kept here to maintain binary compatibility.- See Also:
- Constant Field Values
-
VERSION_OVERRIDE_VAR
@Deprecated public static final java.lang.String VERSION_OVERRIDE_VAR
Deprecated.will be removed in Gradle 9.This field only kept here to maintain binary compatibility.- See Also:
- Constant Field Values
-
VERSION_NUMBER_PROPERTY
@Deprecated public static final java.lang.String VERSION_NUMBER_PROPERTY
Deprecated.will be removed in Gradle 9.This field only kept here to maintain binary compatibility.- See Also:
- Constant Field Values
-
-
Method Detail
-
current
public static GradleVersion current()
Returns the current Gradle version.- Returns:
- The current Gradle version.
-
version
public static GradleVersion version(java.lang.String version) throws java.lang.IllegalArgumentException
Parses the given string into a GradleVersion.- Throws:
java.lang.IllegalArgumentException- On unrecognized version string.
-
getVersion
public abstract java.lang.String getVersion()
Returns the string that represents this version.- Returns:
- this Gradle version in string format.
-
getBuildTime
@Deprecated public abstract java.lang.String getBuildTime()
Deprecated.will be removed in Gradle 9.This method only kept here to maintain binary compatibility.
-
getRevision
@Deprecated public abstract java.lang.String getRevision()
Deprecated.will be removed in Gradle 9.This method only kept here to maintain binary compatibility.
-
isSnapshot
public abstract boolean isSnapshot()
Returnstrueif this instance represent a snapshot version (e.g. 7.0-20210406233629+0000).- Returns:
- Whether the current instance is a snapshot version
-
getBaseVersion
public abstract GradleVersion 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 public abstract GradleVersion getNextMajor()
Deprecated.will be removed in Gradle 9.This method only kept here to maintain binary compatibility.
-
isValid
@Deprecated public abstract boolean isValid()
Deprecated.will be removed in Gradle 9.This method only kept here to maintain binary compatibility.
-
compareTo
public abstract int compareTo(GradleVersion o)
- Specified by:
compareToin interfacejava.lang.Comparable<GradleVersion>
-
-