Package rife.bld.extension
Class ExecOperation
Executes a command on the command line.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncommand()
Returns the command and arguments to be executed.Configures the command and arguments to be executed.command
(Collection<String> args) Configures the command and arguments to be executed.void
execute()
Executes the command.failOnExit
(boolean failOnExit) Configures whether the operation should fail if the command exit value/status is not 0.fromProject
(BaseProject project) Configures an Exec operation from aBaseProject
.boolean
Returns whether the operation should fail if the command exit value/status is not 0.int
timeout()
Returns the command timeout.timeout
(int timeout) Configure the command timeout.workDir()
Returns the working directory.Configures the working directory.Configures the working directory.Configures the working directory.Methods inherited from class rife.bld.operations.AbstractOperation
executeOnce, executeOnce, silent, silent
-
Constructor Details
-
ExecOperation
public ExecOperation()
-
-
Method Details
-
command
Configures the command and arguments to be executed.For example:
command("cmd", "/c", "stop.bat")
command("./stop.sh"
- Parameters:
arg
- one or more arguments- Returns:
- this operation instance
- See Also:
-
command
Returns the command and arguments to be executed.- Returns:
- the command and arguments
-
command
Configures the command and arguments to be executed.- Parameters:
args
- the list of arguments- Returns:
- this operation instance
- See Also:
-
execute
Executes the command.- Specified by:
execute
in classAbstractOperation<ExecOperation>
- Throws:
Exception
-
failOnExit
Configures whether the operation should fail if the command exit value/status is not 0.Default is
TRUE
- Parameters:
failOnExit
- The fail on exit toggle- Returns:
- this operation instance.
-
fromProject
Configures an Exec operation from aBaseProject
.- Parameters:
project
- the project- Returns:
- this operation instance
-
isFailOnExit
public boolean isFailOnExit()Returns whether the operation should fail if the command exit value/status is not 0.- Returns:
true
orfalse
-
timeout
Configure the command timeout.- Parameters:
timeout
- The timeout in seconds- Returns:
- this operation instance
-
timeout
public int timeout()Returns the command timeout.- Returns:
- the timeout
-
workDir
Configures the working directory.- Parameters:
dir
- the directory- Returns:
- this operation instance
-
workDir
Configures the working directory.- Parameters:
dir
- the directory- Returns:
- this operation instance
-
workDir
Configures the working directory.- Parameters:
dir
- the directory path- Returns:
- this operation instance
-
workDir
Returns the working directory.- Returns:
- the directory
-