Package io.github.cdklabs.projen
Class TaskSpec.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.TaskSpec.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskSpecbuild()Builds the configured instance.TaskSpec.Buildercondition(String condition)Sets the value ofTaskCommonOptions.getCondition()TaskSpec.Buildercwd(String cwd)Sets the value ofTaskCommonOptions.getCwd()TaskSpec.Builderdescription(String description)Sets the value ofTaskCommonOptions.getDescription()TaskSpec.Builderenv(Map<String,String> env)Sets the value ofTaskCommonOptions.getEnv()TaskSpec.Buildername(String name)Sets the value ofTaskSpec.getName()TaskSpec.BuilderrequiredEnv(List<String> requiredEnv)Sets the value ofTaskCommonOptions.getRequiredEnv()TaskSpec.Buildersteps(List<? extends TaskStep> steps)Sets the value ofTaskSpec.getSteps()
-
-
-
Method Detail
-
name
@Stability(Experimental) public TaskSpec.Builder name(String name)
Sets the value ofTaskSpec.getName()- Parameters:
name- Task name. This parameter is required.- Returns:
this
-
steps
@Stability(Experimental) public TaskSpec.Builder steps(List<? extends TaskStep> steps)
Sets the value ofTaskSpec.getSteps()- Parameters:
steps- Task steps.- Returns:
this
-
condition
@Stability(Experimental) public TaskSpec.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 TaskSpec.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 TaskSpec.Builder description(String description)
Sets the value ofTaskCommonOptions.getDescription()- Parameters:
description- The description of this build command.- Returns:
this
-
env
@Stability(Experimental) public TaskSpec.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 TaskSpec.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 TaskSpec build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<TaskSpec>- Returns:
- a new instance of
TaskSpec - Throws:
NullPointerException- if any required attribute was not provided
-
-