Class GitExecutor
- java.lang.Object
-
- xyz.ronella.gradle.plugin.simple.git.GitExecutor
-
public class GitExecutor extends java.lang.ObjectThe actual assembler of the git command to execute.- Since:
- 2020-05-05
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(java.util.function.Consumer<IContext> logic)Must hold the execute logic based on the context provided.java.util.List<java.lang.String>getArgs()The git command arguments.static xyz.ronella.gradle.plugin.simple.git.GitExecutor.GitExecutorBuildergetBuilder()The builder of the GitExecutorjava.lang.StringgetCommand()The full command that will be executed.java.nio.file.PathgetDirectory()The directory to run the git command.java.util.List<java.lang.String>getExecArgs()The arguments for the executable.java.lang.StringgetExecutable()The executable to be used in task exec.java.lang.StringgetGitExe()Provides the git executable.java.util.List<java.lang.String>getOpts()The options before the git command.java.nio.file.PathgetScript()Provides the script to use to force in directory execution.static java.lang.StringquoteString(java.lang.String text)A utility for quoting a string.static java.lang.StringquoteString(java.lang.String text, OSType osType)A utility for quoting a string based on os type.
-
-
-
Field Detail
-
OS_TYPE
public static final OSType OS_TYPE
Holds the OS Type
-
GIT_EXE
public static final java.lang.String GIT_EXE
Holds the git executable.
-
-
Method Detail
-
quoteString
public static java.lang.String quoteString(java.lang.String text)
A utility for quoting a string.- Parameters:
text- The text to quote.- Returns:
- A quoted string.
-
quoteString
public static java.lang.String quoteString(java.lang.String text, OSType osType)A utility for quoting a string based on os type. Thus the return value is not necessary a quoted text.- Parameters:
text- The text to quote.osType- The os type.- Returns:
- A quoted string.
-
getGitExe
public java.lang.String getGitExe()
Provides the git executable.- Returns:
- The git executable.
-
getScript
public java.nio.file.Path getScript()
Provides the script to use to force in directory execution.- Returns:
- The path of the script.
-
getDirectory
public java.nio.file.Path getDirectory()
The directory to run the git command.- Returns:
- The directory to run the git command.
-
execute
public void execute(java.util.function.Consumer<IContext> logic)
Must hold the execute logic based on the context provided.- Parameters:
logic- The executed logic with context.
-
getArgs
public java.util.List<java.lang.String> getArgs()
The git command arguments.- Returns:
- An array of arguments.
-
getOpts
public java.util.List<java.lang.String> getOpts()
The options before the git command.- Returns:
- An array of options.
-
getExecutable
public java.lang.String getExecutable()
The executable to be used in task exec.- Returns:
- The executable name.
-
getExecArgs
public java.util.List<java.lang.String> getExecArgs()
The arguments for the executable.- Returns:
- An array of executable args.
-
getCommand
public java.lang.String getCommand()
The full command that will be executed.- Returns:
- The full command.
-
getBuilder
public static xyz.ronella.gradle.plugin.simple.git.GitExecutor.GitExecutorBuilder getBuilder()
The builder of the GitExecutor- Returns:
- An instance of GitExecutorBuilder.
-
-