Package rife.bld.extension
Class JBangOperation
Run JBang with the specified arguments.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionargs()
Retrieves the collection of arguments to be passed to the script.Sets the arguments to be used in thescript
.args
(Collection<String> args) Sets the arguments to be used in thescript
.void
execute()
Performs the operationexitOnFailure
(boolean exitOnFailure) Configures whether the operation should exit upon a JBang execution failure.fromProject
(BaseProject project) Configures a compile operation from aBaseProject
.boolean
Checks whether the operation is configured to exit upon a JBang execution failure.static boolean
isLinux()
Determines if the operating system is Linux.static boolean
isMacOS()
s Determines if the current operating system is macOS.static boolean
Determines if the current operating system is Windows.Retrieves the collection of arguments to be used when running the script.Sets one or more arguments to be used when running the script.jBangArgs
(Collection<String> jBangArgs) Sets the arguments to be used when running thescript
Retrieves the JBang home directory.Sets the JBang home directory.Sets the JBang home directory.Sets the JBang home directory.void
reset()
Resets the state of the operation to its default values.script()
Retrieves the script that has been set for execution.Sets the script to be executed.workDir()
Retrieves the working directory.Provides the working directory if it differs from the project's directory.Provides the working directory if it differs from the project's directory.Provides the working directory if it differs from the project's directory.Methods inherited from class rife.bld.operations.AbstractOperation
executeOnce, executeOnce, silent, silent
-
Constructor Details
-
JBangOperation
public JBangOperation()
-
-
Method Details
-
isLinux
public static boolean isLinux()Determines if the operating system is Linux.- Returns:
- true if the operating system is Linux, false otherwise.
-
isMacOS
public static boolean isMacOS()s Determines if the current operating system is macOS.- Returns:
- true if the OS is macOS, false otherwise.
-
isWindows
public static boolean isWindows()Determines if the current operating system is Windows.- Returns:
- true if the operating system is Windows, false otherwise.
-
args
Sets the arguments to be used in thescript
.- Parameters:
args
- the arguments to use in the script- Returns:
- this operation instance
-
args
Sets the arguments to be used in thescript
.- Parameters:
args
- the arguments to use in the script- Returns:
- this operation instance
-
args
Retrieves the collection of arguments to be passed to the script.- Returns:
- a collection of arguments
-
execute
Performs the operation- Specified by:
execute
in classAbstractOperation<JBangOperation>
- Throws:
Exception
- if an error occurs
-
exitOnFailure
Configures whether the operation should exit upon a JBang execution failure.Default value is
true
- Parameters:
exitOnFailure
-true
if the operation should exit on failure,false
otherwise- Returns:
- this operation instance
-
fromProject
Configures a compile operation from aBaseProject
.Sets the following from the project:
- Parameters:
project
- the project to configure the compile operation from- Returns:
- this operation instance
-
isExitOnFailure
public boolean isExitOnFailure()Checks whether the operation is configured to exit upon a JBang execution failure.Default value is
true
- Returns:
true
if the operation is set to exit on failure,false
otherwise.
-
jBangArgs
Sets the arguments to be used when running thescript
- Parameters:
jBangArgs
- the arguments to use when running the script- Returns:
- this operation instance
-
jBangArgs
Sets one or more arguments to be used when running the script.- Parameters:
jBangArgs
- the arguments to use when running the script- Returns:
- this operation instance
-
jBangArgs
Retrieves the collection of arguments to be used when running the script.- Returns:
- a collection of script arguments
-
jBangHome
Sets the JBang home directory.- Parameters:
jBangHome
- the JBang home directory- Returns:
- this operation instance
-
jBangHome
Sets the JBang home directory.- Parameters:
jBangHome
- the JBang home directory- Returns:
- this operation instance
-
jBangHome
Sets the JBang home directory.- Parameters:
jBangHome
- the JBang home directory- Returns:
- this operation instance
-
jBangHome
Retrieves the JBang home directory.- Returns:
- the JBang home directory
-
reset
public void reset()Resets the state of the operation to its default values.Clears all
jBang arguments
used for execution, resets theexit on failure flag
totrue
, removes the assignedscript
andarguments
. -
script
Sets the script to be executed.- Parameters:
script
- the script to execute- Returns:
- this operation instance
-
script
Retrieves the script that has been set for execution.- Returns:
- the script to be executed or
null
-
workDir
Retrieves the working directory.- Returns:
- the directory
-
workDir
Provides the working directory if it differs from the project's directory.- Parameters:
dir
- the directory- Returns:
- this operation instance
-
workDir
Provides the working directory if it differs from the project's directory.- Parameters:
dir
- the directory- Returns:
- this operation instance
-
workDir
Provides the working directory if it differs from the project's directory.- Parameters:
dir
- the directory path- Returns:
- this operation instance
-