Class Versioning


  • public final class Versioning
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isRelease​(@NotNull org.gradle.api.Project project)
      Verify that this project is checked out to a release version.
      static boolean isSnapshot​(@NotNull org.gradle.api.Project project)  
      static int versionNumber​(@NotNull org.gradle.api.JavaVersion version)  
      static java.lang.String versionString​(int version)  
      static java.lang.String versionString​(@NotNull org.gradle.api.JavaVersion version)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • versionNumber

        public static int versionNumber​(@NotNull
                                        @NotNull org.gradle.api.JavaVersion version)
      • versionString

        public static java.lang.String versionString​(int version)
      • versionString

        public static java.lang.String versionString​(@NotNull
                                                     @NotNull org.gradle.api.JavaVersion version)
      • isSnapshot

        public static boolean isSnapshot​(@NotNull
                                         @NotNull org.gradle.api.Project project)
      • isRelease

        public static boolean isRelease​(@NotNull
                                        @NotNull org.gradle.api.Project project)
        Verify that this project is checked out to a release version.

        This means that:

        • The version does not contain SNAPSHOT
        • The project is managed within a Git repository
        • the current head commit is tagged
        Parameters:
        project - the project to check
        Returns:
        if the project is recognized as a release