Package io.github.cdklabs.projen
Class TaskOptions.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.TaskOptions.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<TaskOptions>
- Enclosing interface:
- TaskOptions
@Stability(Experimental) public static final class TaskOptions.Builder extends Object implements software.amazon.jsii.Builder<TaskOptions>
A builder forTaskOptions
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskOptions.Builderargs(List<String> args)Sets the value ofTaskOptions.getArgs()TaskOptionsbuild()Builds the configured instance.TaskOptions.Buildercondition(String condition)Sets the value ofTaskCommonOptions.getCondition()TaskOptions.Buildercwd(String cwd)Sets the value ofTaskCommonOptions.getCwd()TaskOptions.Builderdescription(String description)Sets the value ofTaskCommonOptions.getDescription()TaskOptions.Builderenv(Map<String,String> env)Sets the value ofTaskCommonOptions.getEnv()TaskOptions.Builderexec(String exec)Sets the value ofTaskOptions.getExec()TaskOptions.BuilderreceiveArgs(Boolean receiveArgs)Sets the value ofTaskOptions.getReceiveArgs()TaskOptions.BuilderrequiredEnv(List<String> requiredEnv)Sets the value ofTaskCommonOptions.getRequiredEnv()TaskOptions.Buildersteps(List<? extends TaskStep> steps)Sets the value ofTaskOptions.getSteps()
-
-
-
Method Detail
-
args
@Stability(Experimental) public TaskOptions.Builder args(List<String> args)
Sets the value ofTaskOptions.getArgs()- Parameters:
args- Should the providedexecshell command receive fixed args.- Returns:
this
-
exec
@Stability(Experimental) public TaskOptions.Builder exec(String exec)
Sets the value ofTaskOptions.getExec()- Parameters:
exec- Shell command to execute as the first command of the task.- Returns:
this
-
receiveArgs
@Stability(Experimental) public TaskOptions.Builder receiveArgs(Boolean receiveArgs)
Sets the value ofTaskOptions.getReceiveArgs()- Parameters:
receiveArgs- Should the providedexecshell command receive args passed to the task.- Returns:
this
-
steps
@Stability(Experimental) public TaskOptions.Builder steps(List<? extends TaskStep> steps)
Sets the value ofTaskOptions.getSteps()- Parameters:
steps- List of task steps to run.- Returns:
this
-
condition
@Stability(Experimental) public TaskOptions.Builder condition(String condition)
Sets the value ofTaskCommonOptions.getCondition()- Parameters:
condition- A shell command which determines if the this task should be executed. If the program exits with a zero exit code, steps will be executed. A non-zero code means that task will be skipped.- Returns:
this
-
cwd
@Stability(Experimental) public TaskOptions.Builder cwd(String cwd)
Sets the value ofTaskCommonOptions.getCwd()- Parameters:
cwd- The working directory for all steps in this task (unless overridden by the step).- Returns:
this
-
description
@Stability(Experimental) public TaskOptions.Builder description(String description)
Sets the value ofTaskCommonOptions.getDescription()- Parameters:
description- The description of this build command.- Returns:
this
-
env
@Stability(Experimental) public TaskOptions.Builder env(Map<String,String> env)
Sets the value ofTaskCommonOptions.getEnv()- Parameters:
env- Defines environment variables for the execution of this task. Values in this map will be evaluated in a shell, so you can do stuff like$(echo "foo").- Returns:
this
-
requiredEnv
@Stability(Experimental) public TaskOptions.Builder requiredEnv(List<String> requiredEnv)
Sets the value ofTaskCommonOptions.getRequiredEnv()- Parameters:
requiredEnv- A set of environment variables that must be defined in order to execute this task. Task execution will fail if one of these is not defined.- Returns:
this
-
build
@Stability(Experimental) public TaskOptions build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<TaskOptions>- Returns:
- a new instance of
TaskOptions - Throws:
NullPointerException- if any required attribute was not provided
-
-