Interface CommandLineTool
-
- All Implemented Interfaces:
public interface CommandLineToolAn interface to implement by classes that are backed by a command line tool.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classCommandLineTool.Companion
-
Method Summary
Modifier and Type Method Description abstract Stringcommand(File workingDir)Return the name of the executable command. StringgetVersionArguments()Get the arguments to pass to the command in order to get its version. StringtransformVersion(String output)Transform the command's version output to a string that only contains the version. RangesListgetVersionRequirement()Return the requirement for the version of the command. BooleanisInPath()Return whether the executable for this command is available in the system PATH. ProcessCapturerun(CharSequence args, File workingDir, Map<String, String> environment)Run the command in the workingDir directory with arguments as specified by args and the given environment. ProcessCapturerun(File workingDir, CharSequence args)Run the command in the workingDir directory with arguments as specified by args. StringgetVersion(File workingDir)Get the version of the command by parsing its output. UnitcheckVersion(File workingDir)Run a command to check its version against the required version. StringdisplayName()The name to use when referring to this command in user facing output. -
-
Method Detail
-
command
abstract String command(File workingDir)
Return the name of the executable command. As the preferred command might depend on the directory to operate in the workingDir can be provided.
-
getVersionArguments
String getVersionArguments()
Get the arguments to pass to the command in order to get its version.
-
transformVersion
String transformVersion(String output)
Transform the command's version output to a string that only contains the version.
-
getVersionRequirement
RangesList getVersionRequirement()
Return the requirement for the version of the command. Defaults to any version.
-
isInPath
Boolean isInPath()
Return whether the executable for this command is available in the system PATH.
-
run
ProcessCapture run(CharSequence args, File workingDir, Map<String, String> environment)
Run the command in the workingDir directory with arguments as specified by args and the given environment.
-
run
ProcessCapture run(File workingDir, CharSequence args)
Run the command in the workingDir directory with arguments as specified by args.
-
getVersion
String getVersion(File workingDir)
Get the version of the command by parsing its output.
-
checkVersion
Unit checkVersion(File workingDir)
Run a command to check its version against the required version.
-
displayName
String displayName()
The name to use when referring to this command in user facing output.
-
-
-
-