Package org.gosulang.gradle.tasks
Class GosuRuntime
- java.lang.Object
-
- org.gosulang.gradle.tasks.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.FilefindGosuJar(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.StringgetGosuVersion(java.io.File gosuJar)Determines the version of a Gosu Jar file (gosu-core, gosu-core-api, etc.).booleanhasGosuc(org.gradle.util.VersionNumber gosuVersion)org.gradle.api.file.FileCollectioninferGosuClasspath(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'.
-
-
-
Method Detail
-
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 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,nullis returned.- Parameters:
classpath- the class path to searchappendix- 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,nullis 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
-
-