Package io.github.cdklabs.projen
Class Task.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.Task.Builder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Task.Builderargs(List<String> args)(experimental) Should the providedexecshell command receive fixed args.Taskbuild()Task.Buildercondition(String condition)(experimental) A shell command which determines if the this task should be executed.static Task.Buildercreate(String name)Task.Buildercwd(String cwd)(experimental) The working directory for all steps in this task (unless overridden by the step).Task.Builderdescription(String description)(experimental) The description of this build command.Task.Builderenv(Map<String,String> env)(experimental) Defines environment variables for the execution of this task.Task.Builderexec(String exec)(experimental) Shell command to execute as the first command of the task.Task.BuilderreceiveArgs(Boolean receiveArgs)(experimental) Should the providedexecshell command receive args passed to the task.Task.BuilderrequiredEnv(List<String> requiredEnv)(experimental) A set of environment variables that must be defined in order to execute this task.Task.Buildersteps(List<? extends TaskStep> steps)(experimental) List of task steps to run.
-
-
-
Method Detail
-
create
@Stability(Experimental) public static Task.Builder create(String name)
- Parameters:
name- This parameter is required.- Returns:
- a new instance of
Task.Builder.
-
condition
@Stability(Experimental) public Task.Builder condition(String condition)
(experimental) 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.
- Parameters:
condition- A shell command which determines if the this task should be executed. This parameter is required.- Returns:
this
-
cwd
@Stability(Experimental) public Task.Builder cwd(String cwd)
(experimental) The working directory for all steps in this task (unless overridden by the step).Default: - process.cwd()
- Parameters:
cwd- The working directory for all steps in this task (unless overridden by the step). This parameter is required.- Returns:
this
-
description
@Stability(Experimental) public Task.Builder description(String description)
(experimental) The description of this build command.Default: - the task name
- Parameters:
description- The description of this build command. This parameter is required.- Returns:
this
-
env
@Stability(Experimental) public Task.Builder env(Map<String,String> env)
(experimental) 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").Default: {}
- Parameters:
env- Defines environment variables for the execution of this task. This parameter is required.- Returns:
this
-
requiredEnv
@Stability(Experimental) public Task.Builder requiredEnv(List<String> requiredEnv)
(experimental) 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.
- Parameters:
requiredEnv- A set of environment variables that must be defined in order to execute this task. This parameter is required.- Returns:
this
-
args
@Stability(Experimental) public Task.Builder args(List<String> args)
(experimental) Should the providedexecshell command receive fixed args.Default: - no arguments are passed to the step
- Parameters:
args- Should the providedexecshell command receive fixed args. This parameter is required.- Returns:
this- See Also:
- TaskStepOptions.args
-
exec
@Stability(Experimental) public Task.Builder exec(String exec)
(experimental) Shell command to execute as the first command of the task.Default: - add steps using `task.exec(command)` or `task.spawn(subtask)`
- Parameters:
exec- Shell command to execute as the first command of the task. This parameter is required.- Returns:
this
-
receiveArgs
@Stability(Experimental) public Task.Builder receiveArgs(Boolean receiveArgs)
(experimental) Should the providedexecshell command receive args passed to the task.Default: false
- Parameters:
receiveArgs- Should the providedexecshell command receive args passed to the task. This parameter is required.- Returns:
this- See Also:
- TaskStepOptions.receiveArgs
-
steps
@Stability(Experimental) public Task.Builder steps(List<? extends TaskStep> steps)
(experimental) List of task steps to run.- Parameters:
steps- List of task steps to run. This parameter is required.- Returns:
this
-
-