Class GosuRuntime

java.lang.Object
org.gosulang.gradle.tasks.GosuRuntime

public class GosuRuntime extends Object
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    findGosuJar(Iterable<File> classpath, 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.).
    Determines the version of a Gosu Jar file (gosu-core, gosu-core-api, etc.).
    boolean
    hasGosuc(VersionNumber gosuVersion)
     
    org.gradle.api.file.FileCollection
    inferGosuClasspath(org.gradle.api.file.FileCollection 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 Details

    • GosuRuntime

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

    • inferGosuClasspath

      public org.gradle.api.file.FileCollection inferGosuClasspath(org.gradle.api.file.FileCollection 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 File findGosuJar(Iterable<File> classpath, 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 String getGosuVersion(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(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