Class GosuRuntime


  • public class GosuRuntime
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      GosuRuntime​(org.gradle.api.Project project)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File findGosuJar​(java.lang.Iterable<java.io.File> classpath, java.lang.String appendix)
      Searches the specified class path for a Gosu Jar file (gosu-core, gosu-core-api, etc.) with the specified appendix (compiler, library, jdbc, etc.).
      java.lang.String getGosuVersion​(java.io.File gosuJar)
      Determines the version of a Gosu Jar file (gosu-core, gosu-core-api, etc.).
      boolean hasGosuc​(org.gradle.util.VersionNumber gosuVersion)  
      groovy.lang.Closure<org.gradle.api.file.FileCollection> inferGosuClasspath​(java.lang.Iterable<java.io.File> classpath)
      Searches the specified classpath for a 'gosu-core-api' Jar, and returns a classpath containing a corresponding (same version) 'gosu-doc' Jar and its dependencies, which includes 'gosu-core'.
      • Methods inherited from class java.lang.Object

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

      • GosuRuntime

        public GosuRuntime​(org.gradle.api.Project project)
    • Method Detail

      • inferGosuClasspath

        public groovy.lang.Closure<org.gradle.api.file.FileCollection> inferGosuClasspath​(java.lang.Iterable<java.io.File> classpath)
        Searches the specified classpath for a 'gosu-core-api' Jar, and returns a classpath containing a corresponding (same version) 'gosu-doc' Jar and its dependencies, which includes 'gosu-core'.

        The returned class path may be empty, or may fail to resolve when asked for its contents.

        Parameters:
        classpath - a classpath containing a 'gosu-core-api' Jar
        Returns:
        a classpath containing a corresponding 'gosu-doc' Jar and its dependencies
      • findGosuJar

        @Nullable
        public java.io.File findGosuJar​(java.lang.Iterable<java.io.File> classpath,
                                        java.lang.String appendix)
        Searches the specified class path for a Gosu Jar file (gosu-core, gosu-core-api, etc.) with the specified appendix (compiler, library, jdbc, etc.). If no such file is found, null is returned.
        Parameters:
        classpath - the class path to search
        appendix - the appendix to search for
        Returns:
        a Gosu Jar file with the specified appendix
      • getGosuVersion

        @Nullable
        public java.lang.String getGosuVersion​(java.io.File gosuJar)
        Determines the version of a Gosu Jar file (gosu-core, gosu-core-api, etc.). If the version cannot be determined, or the file is not a Gosu Jar file, null is returned.

        Implementation note: The version is determined by parsing the file name, which is expected to match the pattern 'gosu-[component]-[version].jar'.

        Parameters:
        gosuJar - a Gosu Jar file
        Returns:
        the version of the Gosu Jar file
      • hasGosuc

        public boolean hasGosuc​(org.gradle.util.VersionNumber gosuVersion)
        Parameters:
        gosuVersion - The VersionNumber of the provided Gosu dependency
        Returns:
        True if the Gosu version contains the gosuc command-line executable (Gosu 1.13.9+, or 1.14.2+); false otherwise