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.voidexecute()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.static booleanisAix()Determines if the current operating system is AIX.static booleanisCygwin()Determines if the current operating system is Cygwin.booleanChecks whether the operation is configured to exit upon a JBang execution failure.static booleanDetermines if the current operating system is FreeBSD.static booleanisLinux()Determines if the operating system is Linux.static booleanisMacOS()Determines if the current operating system is macOS.static booleanisMingw()Determines if the current operating system is MinGW.static booleanDetermines if the current operating system is OpenVMS.static booleanDetermines if the current operating system is Solaris.static booleanDetermines 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 thescriptRetrieves the JBang home directory.Sets the JBang home directory.Sets the JBang home directory.Sets the JBang home directory.voidreset()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
-
execute
Performs the operation- Specified by:
executein classAbstractOperation<JBangOperation>- Throws:
Exception- if an error occurs
-
isAix
public static boolean isAix()Determines if the current operating system is AIX.- Returns:
trueif the operating system is identified as AIX,falseotherwise
-
isCygwin
public static boolean isCygwin()Determines if the current operating system is Cygwin.- Returns:
trueif the operating system is identified as Cygwin,falseotherwise
-
isFreeBsd
public static boolean isFreeBsd()Determines if the current operating system is FreeBSD.- Returns:
trueif the operating system is FreeBSD,falseotherwise
-
isLinux
public static boolean isLinux()Determines if the operating system is Linux.- Returns:
trueif the operating system is Linux,falseotherwise
-
isMacOS
public static boolean isMacOS()Determines if the current operating system is macOS.- Returns:
trueif the OS is macOS,falseotherwise
-
isMingw
public static boolean isMingw()Determines if the current operating system is MinGW.- Returns:
trueif the operating system is identified as MinGW,falseotherwise
-
isOpenVms
public static boolean isOpenVms()Determines if the current operating system is OpenVMS.- Returns:
trueif the operating system is OpenVMS,falseotherwise
-
isSolaris
public static boolean isSolaris()Determines if the current operating system is Solaris.- Returns:
trueif the operating system is Solaris,falseotherwise
-
isWindows
public static boolean isWindows()Determines if the current operating system is Windows.- Returns:
trueif the operating system is Windows,falseotherwise
-
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
-
exitOnFailure
Configures whether the operation should exit upon a JBang execution failure.Default value is
true- Parameters:
exitOnFailure-trueif the operation should exit on failure,falseotherwise- 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:
trueif the operation is set to exit on failure,falseotherwise.
-
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 argumentsused for execution, resets theexit on failure flagtotrue, removes the assignedscriptandarguments. -
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
-